Module Name:    src
Committed By:   christos
Date:           Sun Aug 14 09:06:12 UTC 2011

Modified Files:
        src/external/bsd/file/dist/src: fsmagic.c print.c
        src/external/bsd/file/lib: Makefile

Log Message:
fix non-literal strings where they are not needed.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/file/dist/src/fsmagic.c
cvs rdiff -u -r1.1.1.2 -r1.2 src/external/bsd/file/dist/src/print.c
cvs rdiff -u -r1.1 -r1.2 src/external/bsd/file/lib/Makefile

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

Modified files:

Index: src/external/bsd/file/dist/src/fsmagic.c
diff -u src/external/bsd/file/dist/src/fsmagic.c:1.3 src/external/bsd/file/dist/src/fsmagic.c:1.4
--- src/external/bsd/file/dist/src/fsmagic.c:1.3	Thu May 12 21:52:13 2011
+++ src/external/bsd/file/dist/src/fsmagic.c	Sun Aug 14 05:06:12 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: fsmagic.c,v 1.3 2011/05/13 01:52:13 christos Exp $	*/
+/*	$NetBSD: fsmagic.c,v 1.4 2011/08/14 09:06:12 christos Exp $	*/
 
 /*
  * Copyright (c) Ian F. Darwin 1986-1995.
@@ -37,7 +37,7 @@
 #if 0
 FILE_RCSID("@(#)$File: fsmagic.c,v 1.62 2010/09/20 20:16:08 rrt Exp $")
 #else
-__RCSID("$NetBSD: fsmagic.c,v 1.3 2011/05/13 01:52:13 christos Exp $");
+__RCSID("$NetBSD: fsmagic.c,v 1.4 2011/08/14 09:06:12 christos Exp $");
 #endif
 #endif	/* lint */
 
@@ -69,22 +69,18 @@
 private int
 bad_link(struct magic_set *ms, int err, char *buf)
 {
-	const char *errfmt;
 	int mime = ms->flags & MAGIC_MIME;
 	if ((mime & MAGIC_MIME_TYPE) &&
 	    file_printf(ms, "application/x-symlink")
 	    == -1)
 		return -1;
 	else if (!mime) {
-		if (err == ELOOP)
-			errfmt = "symbolic link in a loop";
-		else
-			errfmt = "broken symbolic link to `%s'";
 		if (ms->flags & MAGIC_ERROR) {
-			file_error(ms, err, errfmt, buf);
+			file_error(ms, err,
+			    "broken symbolic link to `%s'", buf);
 			return -1;
 		} 
-		if (file_printf(ms, errfmt, buf) == -1)
+		if (file_printf(ms, "broken symbolic link to `%s'", buf) == -1)
 			return -1;
 	}
 	return 1;

Index: src/external/bsd/file/dist/src/print.c
diff -u src/external/bsd/file/dist/src/print.c:1.1.1.2 src/external/bsd/file/dist/src/print.c:1.2
--- src/external/bsd/file/dist/src/print.c:1.1.1.2	Thu May 12 16:46:53 2011
+++ src/external/bsd/file/dist/src/print.c	Sun Aug 14 05:06:12 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: print.c,v 1.1.1.2 2011/05/12 20:46:53 christos Exp $	*/
+/*	$NetBSD: print.c,v 1.2 2011/08/14 09:06:12 christos Exp $	*/
 
 /*
  * Copyright (c) Ian F. Darwin 1986-1995.
@@ -37,7 +37,7 @@
 #if 0
 FILE_RCSID("@(#)$File: print.c,v 1.69 2010/07/21 16:47:18 christos Exp $")
 #else
-__RCSID("$NetBSD: print.c,v 1.1.1.2 2011/05/12 20:46:53 christos Exp $");
+__RCSID("$NetBSD: print.c,v 1.2 2011/08/14 09:06:12 christos Exp $");
 #endif
 #endif  /* lint */
 
@@ -58,7 +58,7 @@
 	private const char optyp[] = { FILE_OPS };
 
 	(void) fprintf(stderr, "[%u", m->lineno);
-	(void) fprintf(stderr, ">>>>>>>> %u" + 8 - (m->cont_level & 7),
+	(void) fprintf(stderr, "%.*s %u", (m->cont_level & 7) + 1, ">>>>>>>>",
 		       m->offset);
 
 	if (m->flag & INDIR) {

Index: src/external/bsd/file/lib/Makefile
diff -u src/external/bsd/file/lib/Makefile:1.1 src/external/bsd/file/lib/Makefile:1.2
--- src/external/bsd/file/lib/Makefile:1.1	Fri May  8 13:28:02 2009
+++ src/external/bsd/file/lib/Makefile	Sun Aug 14 05:06:12 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.1 2009/05/08 17:28:02 christos Exp $
+#	$NetBSD: Makefile,v 1.2 2011/08/14 09:06:12 christos Exp $
 #
 
 USE_FORT?= yes	# data driven bugs?
@@ -32,4 +32,6 @@
 INCS=		magic.h
 INCSDIR=	/usr/include
 
+COPTS.softmagic.c = -Wno-format-nonliteral
+
 .include <bsd.lib.mk>

Reply via email to