From 3af54d3ff5de8098e85365c868bd9441072991ab Mon Sep 17 00:00:00 2001 From: David Lawrence Ramsey Date: Wed, 25 Feb 2004 04:43:27 +0000 Subject: [PATCH] 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 --- ChangeLog | 6 ++++++ src/files.c | 11 +---------- src/proto.h | 1 - 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index d5e0b33d..7a702d0d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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) diff --git a/src/files.c b/src/files.c index 8c6d7ea8..2f38eff7 100644 --- a/src/files.c +++ b/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 diff --git a/src/proto.h b/src/proto.h index 8eb94bce..9d054224 100644 --- a/src/proto.h +++ b/src/proto.h @@ -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); -- 2.39.5