tweaks: rename a parameter plus a variable, and reshuffle an assignment
Also improve the comment.master
parent
d3f0d32e16
commit
929e1b6809
12
src/files.c
12
src/files.c
|
@ -2417,18 +2417,16 @@ int diralphasort(const void *va, const void *vb)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef ENABLE_TABCOMP
|
#ifdef ENABLE_TABCOMP
|
||||||
/* Is the given path a directory? */
|
/* Return TRUE when the given path is a directory. */
|
||||||
bool is_dir(const char *buf)
|
bool is_dir(const char *path)
|
||||||
{
|
{
|
||||||
char *dirptr;
|
char *realpath = real_dir_from_tilde(path);
|
||||||
struct stat fileinfo;
|
struct stat fileinfo;
|
||||||
bool retval;
|
bool retval;
|
||||||
|
|
||||||
dirptr = real_dir_from_tilde(buf);
|
retval = (stat(realpath, &fileinfo) != -1 && S_ISDIR(fileinfo.st_mode));
|
||||||
|
|
||||||
retval = (stat(dirptr, &fileinfo) != -1 && S_ISDIR(fileinfo.st_mode));
|
free(realpath);
|
||||||
|
|
||||||
free(dirptr);
|
|
||||||
|
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue