summaryrefslogtreecommitdiff
path: root/lib-src
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2004-04-26 10:48:06 +0000
committerEli Zaretskii <eliz@gnu.org>2004-04-26 10:48:06 +0000
commit7af99c29d2cc092e5649f7c0b7b5fb19feb932d1 (patch)
tree848de97180284538f6270d2a5ab07c1f5e048c2a /lib-src
parent9afdb1bbf3e78e295ff7a23c12c8fed9fad1dfa9 (diff)
downloademacs-7af99c29d2cc092e5649f7c0b7b5fb19feb932d1.tar.gz
(IS_DIRECTORY_SEP): New macro.
(put_filename): Remove unused variable len. Use IS_DIRECTORY_SEP instead of a literal '/'.
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/make-docfile.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/lib-src/make-docfile.c b/lib-src/make-docfile.c
index ba73f5800a7..1c0bc559225 100644
--- a/lib-src/make-docfile.c
+++ b/lib-src/make-docfile.c
@@ -60,6 +60,10 @@ Boston, MA 02111-1307, USA. */
#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 @@ void
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);