#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: fsmagic.c,v 1.63 2011/07/12 11:31:59 rrt Exp $")
+FILE_RCSID("@(#)$File: fsmagic.c,v 1.64 2011/08/14 09:03:12 christos Exp $")
#endif /* lint */
#include "magic.h"
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, "inode/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;
#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: print.c,v 1.69 2010/07/21 16:47:18 christos Exp $")
+FILE_RCSID("@(#)$File: print.c,v 1.70 2011/08/14 09:03:12 christos Exp $")
#endif /* lint */
#include <string.h>
{
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) {