miscellaneous minor fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2649 35c25a1d-7b9e-4130-9fde-d3aeb78583b8master
parent
7b601fdbe1
commit
6a0d5b8fec
|
@ -197,6 +197,8 @@ CVS code -
|
||||||
- utils.c:
|
- utils.c:
|
||||||
num_of_digits()
|
num_of_digits()
|
||||||
- Use a size_t instead of an int, and rename to digits(). (DLR)
|
- Use a size_t instead of an int, and rename to digits(). (DLR)
|
||||||
|
align()
|
||||||
|
- Rename variable strp to str for consistency. (DLR)
|
||||||
- winio.c:
|
- winio.c:
|
||||||
do_statusbar_output()
|
do_statusbar_output()
|
||||||
- Don't set answer_len until after it's been asserted that
|
- Don't set answer_len until after it's been asserted that
|
||||||
|
@ -206,6 +208,7 @@ CVS code -
|
||||||
for len plus a trailing multibyte character and/or tab. (DLR)
|
for len plus a trailing multibyte character and/or tab. (DLR)
|
||||||
- Don't check for multicolumn characters if the NO_UTF8 flag
|
- Don't check for multicolumn characters if the NO_UTF8 flag
|
||||||
isn't set. (DLR)
|
isn't set. (DLR)
|
||||||
|
- Free buf_mb when we're done using it. (DLR)
|
||||||
nanogetstr()
|
nanogetstr()
|
||||||
- Rename variable def to curranswer to avoid confusion. (DLR)
|
- Rename variable def to curranswer to avoid confusion. (DLR)
|
||||||
- Only declare and use the tabbed variable if DISABLE_TABCOMP
|
- Only declare and use the tabbed variable if DISABLE_TABCOMP
|
||||||
|
|
|
@ -265,11 +265,12 @@ char *make_mbchar(int chr, int *chr_mb_len)
|
||||||
wctomb(NULL, 0);
|
wctomb(NULL, 0);
|
||||||
*chr_mb_len = 0;
|
*chr_mb_len = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
align(&chr_mb);
|
||||||
} else {
|
} else {
|
||||||
#endif
|
#endif
|
||||||
*chr_mb_len = 1;
|
*chr_mb_len = 1;
|
||||||
chr_mb = charalloc(1);
|
chr_mb = mallocstrncpy(NULL, (char *)&chr, 1);
|
||||||
*chr_mb = (char)chr;
|
|
||||||
#ifdef NANO_WIDE
|
#ifdef NANO_WIDE
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -2801,6 +2801,7 @@ char *do_browser(char *path, DIR *dir)
|
||||||
if (width == 0)
|
if (width == 0)
|
||||||
width = filecols;
|
width = filecols;
|
||||||
}
|
}
|
||||||
|
|
||||||
wmove(edit, editline, col);
|
wmove(edit, editline, col);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -561,6 +561,7 @@ void help_init(void)
|
||||||
|
|
||||||
free(help_ptr);
|
free(help_ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
ptr += sprintf(ptr, "\n");
|
ptr += sprintf(ptr, "\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1470,10 +1471,10 @@ bool do_next_word(bool allow_update)
|
||||||
* line. */
|
* line. */
|
||||||
if (!is_word_mbchar(char_mb))
|
if (!is_word_mbchar(char_mb))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* If we haven't found it, then we've started on a word, so set
|
/* If we haven't found it, then we've started on a word, so set
|
||||||
* started_on_word to TRUE. */
|
* started_on_word to TRUE. */
|
||||||
else
|
started_on_word = TRUE;
|
||||||
started_on_word = TRUE;
|
|
||||||
|
|
||||||
current_x += char_mb_len;
|
current_x += char_mb_len;
|
||||||
}
|
}
|
||||||
|
|
|
@ -181,7 +181,7 @@ char *control_mbrep(const char *c, char *crep, int *crep_len);
|
||||||
int mbwidth(const char *c);
|
int mbwidth(const char *c);
|
||||||
int mb_cur_max(void);
|
int mb_cur_max(void);
|
||||||
char *make_mbchar(int chr, int *chr_mb_len);
|
char *make_mbchar(int chr, int *chr_mb_len);
|
||||||
#if defined(ENABLE_NANORC) || defined(ENABLE_EXTRA)
|
#if defined(ENABLE_NANORC) || defined(NANO_EXTRA)
|
||||||
char *make_mbstring(const char *str);
|
char *make_mbstring(const char *str);
|
||||||
#endif
|
#endif
|
||||||
int parse_mbchar(const char *buf, char *chr, bool *bad_chr, size_t
|
int parse_mbchar(const char *buf, char *chr, bool *bad_chr, size_t
|
||||||
|
@ -549,7 +549,7 @@ int digits(size_t n);
|
||||||
void get_homedir(void);
|
void get_homedir(void);
|
||||||
bool parse_num(const char *str, ssize_t *val);
|
bool parse_num(const char *str, ssize_t *val);
|
||||||
bool parse_line_column(const char *str, int *line, ssize_t *column);
|
bool parse_line_column(const char *str, int *line, ssize_t *column);
|
||||||
void align(char **strp);
|
void align(char **str);
|
||||||
void null_at(char **data, size_t index);
|
void null_at(char **data, size_t index);
|
||||||
void unsunder(char *str, size_t true_len);
|
void unsunder(char *str, size_t true_len);
|
||||||
void sunder(char *str);
|
void sunder(char *str);
|
||||||
|
|
|
@ -139,12 +139,12 @@ bool parse_line_column(const char *str, int *line, ssize_t *column)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Fix the memory allocation for a string. */
|
/* Fix the memory allocation for a string. */
|
||||||
void align(char **strp)
|
void align(char **str)
|
||||||
{
|
{
|
||||||
assert(strp != NULL);
|
assert(str != NULL);
|
||||||
|
|
||||||
if (*strp != NULL)
|
if (*str != NULL)
|
||||||
*strp = charealloc(*strp, strlen(*strp) + 1);
|
*str = charealloc(*str, strlen(*str) + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Null a string at a certain index and align it. */
|
/* Null a string at a certain index and align it. */
|
||||||
|
|
|
@ -2380,6 +2380,8 @@ char *display_string(const char *buf, size_t start_col, size_t len, bool
|
||||||
start_index += buf_mb_len;
|
start_index += buf_mb_len;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
free(buf_mb);
|
||||||
|
|
||||||
if (index < alloc_len - 1)
|
if (index < alloc_len - 1)
|
||||||
converted[index] = '\0';
|
converted[index] = '\0';
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue