aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src
diff options
context:
space:
mode:
authorFrancesco Potortì1993-10-01 09:51:07 +0000
committerFrancesco Potortì1993-10-01 09:51:07 +0000
commit2b878b4c6b5b1ad0d2c3ef199b8e5c74d4c791d9 (patch)
treeb0619598125c7bb475a561bea34186e489a3d6a6 /lib-src
parent4b431fb7fce9e6c69540d2b07a1ed9dca405493e (diff)
downloademacs-2b878b4c6b5b1ad0d2c3ef199b8e5c74d4c791d9.tar.gz
emacs-2b878b4c6b5b1ad0d2c3ef199b8e5c74d4c791d9.zip
* etags.c (process_file): dead code removed.
(S_ISREG): #define it using S_IFREG if not defined. (process_file): regular files have nothing to do with symlinks.
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/etags.c24
1 files changed, 7 insertions, 17 deletions
diff --git a/lib-src/etags.c b/lib-src/etags.c
index c21fe560c6f..491b3d5f51c 100644
--- a/lib-src/etags.c
+++ b/lib-src/etags.c
@@ -25,7 +25,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
25 * Gnu Emacs TAGS format and modifications by RMS? 25 * Gnu Emacs TAGS format and modifications by RMS?
26 * Sam Kendall added C++. 26 * Sam Kendall added C++.
27 * 27 *
28 * Francesco Potorti` is the current maintainer. 8.3 28 * Francesco Potorti` (pot@cnuce.cnr.it) is the current maintainer. 9.4
29 */ 29 */
30 30
31#ifdef HAVE_CONFIG_H 31#ifdef HAVE_CONFIG_H
@@ -37,6 +37,10 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
37#include <sys/types.h> 37#include <sys/types.h>
38#include <sys/stat.h> 38#include <sys/stat.h>
39 39
40#if !defined (S_ISREG) && defined (S_IFREG)
41# define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
42#endif
43
40#include "getopt.h" 44#include "getopt.h"
41 45
42extern char *malloc (), *realloc (); 46extern char *malloc (), *realloc ();
@@ -784,12 +788,7 @@ process_file (file)
784{ 788{
785 struct stat stat_buf; 789 struct stat stat_buf;
786 790
787 stat (file, &stat_buf); 791 if (stat (file, &stat_buf) || !S_ISREG (stat_buf.st_mode))
788 if (!(stat_buf.st_mode & S_IFREG)
789#ifdef S_IFLNK
790 || !(stat_buf.st_mode & S_IFLNK)
791#endif
792 )
793 { 792 {
794 fprintf (stderr, "Skipping %s: it is not a regular file.\n", file); 793 fprintf (stderr, "Skipping %s: it is not a regular file.\n", file);
795 return; 794 return;
@@ -800,19 +799,10 @@ process_file (file)
800 fprintf (stderr, "Skipping inclusion of %s in self.\n", file); 799 fprintf (stderr, "Skipping inclusion of %s in self.\n", file);
801 return; 800 return;
802 } 801 }
803 if (emacs_tags_format)
804 {
805 char *cp = etags_rindex (file, '/');
806 if (cp)
807 ++cp;
808 else
809 cp = file;
810 }
811 find_entries (file); 802 find_entries (file);
812 if (emacs_tags_format) 803 if (emacs_tags_format)
813 { 804 {
814 fprintf (outf, "\f\n%s,%d\n", 805 fprintf (outf, "\f\n%s,%d\n", file, total_size_of_entries (head));
815 file, total_size_of_entries (head));
816 put_entries (head); 806 put_entries (head);
817 free_tree (head); 807 free_tree (head);
818 head = NULL; 808 head = NULL;