From b09c560845ae108ac90675000eeacc2add6eb2b5 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Mon, 26 Apr 2004 10:49:11 +0000 Subject: [PATCH] (IS_DIRECTORY_SEP): New macro. (put_filename): Remove unused variable len. Use IS_DIRECTORY_SEP instead of a literal '/'. --- lib-src/ChangeLog | 6 ++++++ lib-src/make-docfile.c | 16 +++++++++++----- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index eaf07239901..e2fcc6cc939 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog @@ -1,3 +1,9 @@ +2004-04-26 Eli Zaretskii + + * make-docfile.c (IS_DIRECTORY_SEP): New macro. + (put_filename): Remove unused variable len. Use IS_DIRECTORY_SEP + instead of a literal '/'. + 2004-04-23 Juanma Barranquero * makefile.w32-in: Add "-*- makefile -*-" mode tag. 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); -- 2.39.5