mirror of
git://git.sv.gnu.org/nano.git
synced 2025-02-14 04:14:16 +03:00
tweaks: rename a parameter plus a variable, and reshuffle an assignment
Also improve the comment.
This commit is contained in:
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
|
||||
|
||||
#ifdef ENABLE_TABCOMP
|
||||
/* Is the given path a directory? */
|
||||
bool is_dir(const char *buf)
|
||||
/* Return TRUE when the given path is a directory. */
|
||||
bool is_dir(const char *path)
|
||||
{
|
||||
char *dirptr;
|
||||
char *realpath = real_dir_from_tilde(path);
|
||||
struct stat fileinfo;
|
||||
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(dirptr);
|
||||
free(realpath);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user