changeset 55147:c2f1d71314c4

(IS_DIRECTORY_SEP): New macro. (put_filename): Remove unused variable len. Use IS_DIRECTORY_SEP instead of a literal '/'.
author Eli Zaretskii <eliz@gnu.org>
date Mon, 26 Apr 2004 10:48:06 +0000
parents 1a8fe9f88f09
children b448a66be3a5
files lib-src/make-docfile.c
diffstat 1 files changed, 11 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/lib-src/make-docfile.c	Mon Apr 26 03:13:43 2004 +0000
+++ b/lib-src/make-docfile.c	Mon Apr 26 10:48:06 2004 +0000
@@ -60,6 +60,10 @@
 #define READ_BINARY "r"
 #endif /* not DOS_NT */
 
+#ifndef IS_DIRECTORY_SEP
+#define IS_DIRECTORY_SEP(_c_) ((_c_) == '/')
+#endif
+
 int scan_file ();
 int scan_lisp_file ();
 int scan_c_file ();
@@ -183,11 +187,13 @@
 put_filename (filename)
      char *filename;
 {
-  char *tmp = filename;
-  int len;
-  
-  while ((tmp = index (filename, '/')))
-    filename = tmp + 1;
+  char *tmp;
+
+  for (tmp = filename; *tmp; tmp++)
+    {
+      if (IS_DIRECTORY_SEP(*tmp))
+	filename = tmp + 1;
+    }
 
   putc (037, outfile);
   putc ('S', outfile);