Module Name:    src
Committed By:   mrg
Date:           Tue May  8 23:05:17 UTC 2018

Modified Files:
        src/usr.bin/crunch/crunchgen: crunchgen.c

Log Message:
in dir_search(), don't assume a directory existing is useful, instead
confirm that there is a non zero makefile in there.  (this assumes
the makefile is called "Makefile", which is assumed in other places
in crunchgen.c already, so this doesn't make it worse.)

this fixes build issues when an empty subdir exists because some files
were moved subdir at some stage (ktrace, rcorder), and a non-prune
update may look in the wrong dir.

bump version (lots of updates between now and the previous update.)


To generate a diff of this commit:
cvs rdiff -u -r1.85 -r1.86 src/usr.bin/crunch/crunchgen/crunchgen.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/crunch/crunchgen/crunchgen.c
diff -u src/usr.bin/crunch/crunchgen/crunchgen.c:1.85 src/usr.bin/crunch/crunchgen/crunchgen.c:1.86
--- src/usr.bin/crunch/crunchgen/crunchgen.c:1.85	Sun Oct  8 15:06:17 2017
+++ src/usr.bin/crunch/crunchgen/crunchgen.c	Tue May  8 23:05:17 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: crunchgen.c,v 1.85 2017/10/08 15:06:17 christos Exp $	*/
+/*	$NetBSD: crunchgen.c,v 1.86 2018/05/08 23:05:17 mrg Exp $	*/
 /*
  * Copyright (c) 1994 University of Maryland
  * All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include <sys/cdefs.h>
 #if !defined(lint)
-__RCSID("$NetBSD: crunchgen.c,v 1.85 2017/10/08 15:06:17 christos Exp $");
+__RCSID("$NetBSD: crunchgen.c,v 1.86 2018/05/08 23:05:17 mrg Exp $");
 #endif
 
 #include <stdlib.h>
@@ -55,7 +55,7 @@ __RCSID("$NetBSD: crunchgen.c,v 1.85 201
 #include <sys/param.h>
 #include <sys/utsname.h>
 
-#define CRUNCH_VERSION	"20050208"
+#define CRUNCH_VERSION	"20180508"
 
 #define MAXLINELEN	16384
 #define MAXFIELDS 	 2048
@@ -907,8 +907,8 @@ dir_search(char *progname)
     strlst_t *dir;
 
     for (dir=srcdirs; dir != NULL; dir=dir->next) {
-	(void)snprintf(path, sizeof(path), "%s/%s", dir->str, progname);
-	if (is_dir(path))
+	snprintf(path, sizeof(path), "%s/%s/Makefile", dir->str, progname);
+	if (is_nonempty_file(path))
 	    return dir->str;
     }
     return NULL;

Reply via email to