mirror of
git://git.sv.gnu.org/nano.git
synced 2024-11-25 22:29:42 +03:00
tweaks: drop two unneeded assignments
The variable is set to zero at its declaration, and the second function is called only when the first is either not called or found nothing -- thus '*num_matches' will still be zero.
This commit is contained in:
parent
2770ec81e2
commit
23c62c5032
@ -2388,11 +2388,7 @@ char **username_tab_completion(const char *buf, size_t *num_matches,
|
||||
char **matches = NULL;
|
||||
#ifdef HAVE_PWD_H
|
||||
const struct passwd *userdata;
|
||||
#endif
|
||||
|
||||
*num_matches = 0;
|
||||
|
||||
#ifdef HAVE_PWD_H
|
||||
while ((userdata = getpwent()) != NULL) {
|
||||
if (strncmp(userdata->pw_name, buf + 1, buf_len - 1) == 0) {
|
||||
/* Cool, found a match. Add it to the list. This makes a
|
||||
@ -2430,7 +2426,6 @@ char **cwd_tab_completion(const char *buf, bool allow_files,
|
||||
DIR *dir;
|
||||
const struct dirent *nextdir;
|
||||
|
||||
*num_matches = 0;
|
||||
dirname[buf_len] = '\0';
|
||||
|
||||
/* If there's a / in the name, split out filename and directory parts. */
|
||||
|
Loading…
Reference in New Issue
Block a user