mirror of git://git.sv.gnu.org/nano.git
remove the redundant filestat() and replace it with stat() in the one
place it's called git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1665 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
This commit is contained in:
parent
37853fd4ce
commit
3af54d3ff5
|
@ -28,6 +28,12 @@ CVS code -
|
|||
write_marked()
|
||||
- New function used to write the current marked selection to a
|
||||
file, split out from do_writeout(). (DLR)
|
||||
filestat()
|
||||
- Removed, as it is only called in one place and is
|
||||
redundant. (DLR)
|
||||
do_browser()
|
||||
- Replace the filestat() call with an equivalent stat() call.
|
||||
(DLR)
|
||||
- global.c:
|
||||
shortcut_init()
|
||||
- Only allow verbatim input when we're not in view mode. (DLR)
|
||||
|
|
11
src/files.c
11
src/files.c
|
@ -2369,15 +2369,6 @@ char *input_tab(char *buf, int place, int *lastwastab, int *newplace, int *list)
|
|||
#endif /* !DISABLE_TABCOMP */
|
||||
|
||||
#ifndef DISABLE_BROWSER
|
||||
/* Return the stat of the file pointed to by path */
|
||||
struct stat filestat(const char *path)
|
||||
{
|
||||
struct stat st;
|
||||
|
||||
stat(path, &st);
|
||||
return st;
|
||||
}
|
||||
|
||||
/* Our sort routine for file listings -- sort directories before
|
||||
* files, and then alphabetically. */
|
||||
int diralphasort(const void *va, const void *vb)
|
||||
|
@ -2780,7 +2771,7 @@ char *do_browser(const char *inpath)
|
|||
if (S_ISLNK(st.st_mode)) {
|
||||
/* Aha! It's a symlink! Now, is it a dir? If so,
|
||||
mark it as such */
|
||||
st = filestat(filelist[j]);
|
||||
stat(filelist[j], &st);
|
||||
if (S_ISDIR(st.st_mode))
|
||||
strcpy(foo + longest - 5, "(dir)");
|
||||
else
|
||||
|
|
|
@ -193,7 +193,6 @@ char **cwd_tab_completion(char *buf, int *num_matches);
|
|||
char *input_tab(char *buf, int place, int *lastwastab, int *newplace, int *list);
|
||||
#endif
|
||||
#ifndef DISABLE_BROWSER
|
||||
struct stat filestat(const char *path);
|
||||
int diralphasort(const void *va, const void *vb);
|
||||
void free_charptrarray(char **array, int len);
|
||||
const char *tail(const char *foo);
|
||||
|
|
Loading…
Reference in New Issue