Module Name:    src
Committed By:   christos
Date:           Wed May 26 18:07:34 UTC 2010

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

Log Message:
fix empty suffix case.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/usr.bin/mkdep/mkdep.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/mkdep/mkdep.c
diff -u src/usr.bin/mkdep/mkdep.c:1.34 src/usr.bin/mkdep/mkdep.c:1.35
--- src/usr.bin/mkdep/mkdep.c:1.34	Wed May 26 11:04:40 2010
+++ src/usr.bin/mkdep/mkdep.c	Wed May 26 14:07:34 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: mkdep.c,v 1.34 2010/05/26 15:04:40 christos Exp $ */
+/* $NetBSD: mkdep.c,v 1.35 2010/05/26 18:07:34 christos Exp $ */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
 #if !defined(lint)
 __COPYRIGHT("@(#) Copyright (c) 1999 The NetBSD Foundation, Inc.\
  All rights reserved.");
-__RCSID("$NetBSD: mkdep.c,v 1.34 2010/05/26 15:04:40 christos Exp $");
+__RCSID("$NetBSD: mkdep.c,v 1.35 2010/05/26 18:07:34 christos Exp $");
 #endif /* not lint */
 
 #include <sys/mman.h>
@@ -269,7 +269,7 @@
 		if (suff_list == NULL)
 			err(2, "malloc");
 		sl = suff_list;
-		for (s = suffixes; (s = strchr(s, '.')); s += sz, sl++ ) {
+		for (s = suffixes; (s = strchr(s, '.')); s += sz, sl++) {
 			sz = strcspn(s, ", ");
 			if (sz > sizeof sl->suff)
 				errx(2, "suffix too long");
@@ -368,7 +368,7 @@
 				 * Not found, check for .o, since the
 				 * original file will have it.
 				 */
-				if (sl->len == 0) {
+				if (sl->len == 0 && suff_list->len != 0) {
 					if (memcmp(suf - 2, ".o", 2) == 0)
 						slen = 2;
 					else

Reply via email to