Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/external/bsd/file fix non-literal strings where they are not...
details: https://anonhg.NetBSD.org/src/rev/1273221f5afa
branches: trunk
changeset: 768297:1273221f5afa
user: christos <christos%NetBSD.org@localhost>
date: Sun Aug 14 09:06:12 2011 +0000
description:
fix non-literal strings where they are not needed.
diffstat:
external/bsd/file/dist/src/fsmagic.c | 14 +++++---------
external/bsd/file/dist/src/print.c | 6 +++---
external/bsd/file/lib/Makefile | 4 +++-
3 files changed, 11 insertions(+), 13 deletions(-)
diffs (87 lines):
diff -r ee664db43b66 -r 1273221f5afa external/bsd/file/dist/src/fsmagic.c
--- a/external/bsd/file/dist/src/fsmagic.c Sun Aug 14 09:02:07 2011 +0000
+++ b/external/bsd/file/dist/src/fsmagic.c Sun Aug 14 09:06:12 2011 +0000
@@ -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;
diff -r ee664db43b66 -r 1273221f5afa external/bsd/file/dist/src/print.c
--- a/external/bsd/file/dist/src/print.c Sun Aug 14 09:02:07 2011 +0000
+++ b/external/bsd/file/dist/src/print.c Sun Aug 14 09:06:12 2011 +0000
@@ -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) {
diff -r ee664db43b66 -r 1273221f5afa external/bsd/file/lib/Makefile
--- a/external/bsd/file/lib/Makefile Sun Aug 14 09:02:07 2011 +0000
+++ b/external/bsd/file/lib/Makefile Sun Aug 14 09:06:12 2011 +0000
@@ -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>
Home |
Main Index |
Thread Index |
Old Index