in parse_rcfile(), properly handle rcfiles that don't end in newlines
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3576 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
Этот коммит содержится в:
родитель
db39a5e80d
Коммит
5566e442b1
@ -262,6 +262,7 @@ CVS code -
|
|||||||
any associated color commands. (DLR)
|
any associated color commands. (DLR)
|
||||||
- Change variable i from an int to a size_t, for consistency.
|
- Change variable i from an int to a size_t, for consistency.
|
||||||
(DLR)
|
(DLR)
|
||||||
|
- Properly handle rcfiles that don't end in newlines. (DLR)
|
||||||
do_rcfile()
|
do_rcfile()
|
||||||
- Check for the rcfile's being a directory or device file and
|
- Check for the rcfile's being a directory or device file and
|
||||||
reject it if it is, for consistency with file handling
|
reject it if it is, for consistency with file handling
|
||||||
|
@ -622,6 +622,7 @@ void parse_rcfile(FILE *rcstream
|
|||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
/* Ignore the newline. */
|
/* Ignore the newline. */
|
||||||
|
if (buf[len - 1] == '\n')
|
||||||
buf[len - 1] = '\0';
|
buf[len - 1] = '\0';
|
||||||
|
|
||||||
lineno++;
|
lineno++;
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user