#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: compress.c,v 1.69 2012/08/26 10:21:37 christos Exp $")
+FILE_RCSID("@(#)$File: compress.c,v 1.70 2012/11/07 17:54:48 christos Exp $")
#endif
#include "magic.h"
if (file_printf(ms, mime ?
" compressed-encoding=" : " (") == -1)
goto error;
+ if (file_buffer(ms, -1, NULL, buf, nbytes) == -1)
+ goto error;
+ if (!mime && file_printf(ms, ")") == -1)
+ goto error;
}
- if ((mime == 0 || mime & MAGIC_MIME_ENCODING) &&
- file_buffer(ms, -1, NULL, buf, nbytes) == -1)
- goto error;
-
- if (!mime && file_printf(ms, ")") == -1)
- goto error;
rv = 1;
break;
}
#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: funcs.c,v 1.60 2011/12/08 12:38:24 rrt Exp $")
+FILE_RCSID("@(#)$File: funcs.c,v 1.61 2012/10/30 23:11:51 christos Exp $")
#endif /* lint */
#include "magic.h"
if ((m = file_zmagic(ms, fd, inname, ubuf, nb)) != 0) {
if ((ms->flags & MAGIC_DEBUG) != 0)
(void)fprintf(stderr, "zmagic %d\n", m);
- goto done;
+ goto done_encoding;
}
#endif
/* Check if we have a tar file */
if (file_printf(ms, "%s", code_mime) == -1)
rv = -1;
}
+ done_encoding:
free(u8buf);
if (rv)
return rv;