Module Name:    src
Committed By:   christos
Date:           Thu Jul 18 16:01:25 UTC 2013

Modified Files:
        src/usr.bin/man: man.c

Log Message:
Set the string to NUL instread of providing an new empty string (from uwe)


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/usr.bin/man/man.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/man/man.c
diff -u src/usr.bin/man/man.c:1.48 src/usr.bin/man/man.c:1.49
--- src/usr.bin/man/man.c:1.48	Thu Jul 18 11:39:08 2013
+++ src/usr.bin/man/man.c	Thu Jul 18 12:01:25 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: man.c,v 1.48 2013/07/18 15:39:08 christos Exp $	*/
+/*	$NetBSD: man.c,v 1.49 2013/07/18 16:01:25 christos Exp $	*/
 
 /*
  * Copyright (c) 1987, 1993, 1994, 1995
@@ -40,7 +40,7 @@ __COPYRIGHT("@(#) Copyright (c) 1987, 19
 #if 0
 static char sccsid[] = "@(#)man.c	8.17 (Berkeley) 1/31/95";
 #else
-__RCSID("$NetBSD: man.c,v 1.48 2013/07/18 15:39:08 christos Exp $");
+__RCSID("$NetBSD: man.c,v 1.49 2013/07/18 16:01:25 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -122,8 +122,6 @@ static void	 addpath(struct manstate *, 
 static const char *getclass(const char *);
 static void printmanpath(struct manstate *);
 
-static char EMPTY[1];
-
 /*
  * main function
  */
@@ -587,14 +585,14 @@ manual(char *page, struct manstate *mp, 
 				if (!mp->all) {
 					/* Delete any other matches. */
 					while (++cnt< pg->gl_pathc)
-						pg->gl_pathv[cnt] = EMPTY;
+						*pg->gl_pathv[cnt] = '\0';
 					break;
 				}
 				continue;
 			}
 
 			/* It's not a man page, forget about it. */
-			pg->gl_pathv[cnt] = EMPTY;
+			*pg->gl_pathv[cnt] = '\0';
 		}
 
   notfound:
@@ -643,7 +641,7 @@ manual(char *page, struct manstate *mp, 
 			if (mp->pathsearch) {
 				p = strstr(pg->gl_pathv[cnt], mp->pathsearch);
 				if (!p || strchr(p, '/') == NULL) {
-					pg->gl_pathv[cnt] = EMPTY; /* zap! */
+					*pg->gl_pathv[cnt] = '\0'; /* zap! */
 					continue;
 				}
 			}
@@ -682,14 +680,14 @@ next:				anyfound = 1;
 				if (!mp->all) {
 					/* Delete any other matches. */
 					while (++cnt< pg->gl_pathc)
-						pg->gl_pathv[cnt] = EMPTY;
+						*pg->gl_pathv[cnt] = '\0';
 					break;
 				}
 				continue;
 			}
 
 			/* It's not a man page, forget about it. */
-			pg->gl_pathv[cnt] = EMPTY;
+			*pg->gl_pathv[cnt] = '\0';
 		}
 
 		if (anyfound && !mp->all)

Reply via email to