- Fix segfault when dealing with directory names that begin with
"~", but that aren't users' home directories. (DLR, found by
Justin Fletcher)
+ - Fix long-standing problem where directory names that began
+ with "~", but that weren't users' home directories, could be
+ erroneously treated as users' home directories (e.g. "~d/"
+ would be treated as "~daemon/"). (DLR, found by Justin
+ Fletcher)
- doc/syntax/asm.nanorc, doc/syntax/c.nanorc, doc/syntax/sh.nanorc:
- Copy the regex that highlights trailing whitespace from
doc/syntax/java.nanorc to these files, as it's also useful in
do {
userdata = getpwent();
} while (userdata != NULL &&
- strncmp(userdata->pw_name, buf + 1, i - 1) != 0);
+ (strncmp(userdata->pw_name, buf + 1, i - 1) != 0 ||
+ strlen(userdata->pw_name) != strnlen(buf + 1, i - 1)));
endpwent();
if (userdata != NULL)
tilde_dir = userdata->pw_dir;