File output on powerpoint presentation
Radek Vokál
rvokal at redhat.com
Tue May 9 09:32:44 EEST 2006
No, the output is still same. There's a leading space and -ib shows
nothing.
# file -ikb ~rvokal/work/file/LecturesPart01.ppt
\012- application/msword\012- application/msword
Radek
On Wed, 2006-05-03 at 11:10 -0400, Christos Zoulas wrote:
> On May 3, 2:59pm, rvokal at redhat.com (Radek =?ISO-8859-1?Q?Vok=E1l?=) wrote:
> -- Subject: Re: File output on powerpoint presentation
>
> Here's a patch. Please let me know if it works for you!
>
> Thanks,
>
> christos
>
> Index: softmagic.c
> ===================================================================
> RCS file: /src/pub/file/src/softmagic.c,v
> retrieving revision 1.78
> diff -u -u -r1.78 softmagic.c
> --- softmagic.c 12 Mar 2006 22:09:33 -0000 1.78
> +++ softmagic.c 3 May 2006 14:55:09 -0000
> @@ -53,6 +53,7 @@
> const unsigned char *, size_t, size_t);
> private int mconvert(struct magic_set *, union VALUETYPE *, struct magic *);
> private int check_mem(struct magic_set *, unsigned int);
> +private int print_sep(struct magic_set *, int);
>
> /*
> * softmagic - lookup one file in database
> @@ -141,21 +142,20 @@
> continue;
> }
>
> - if (!firstline) { /* we found another match */
> - /* put a newline and '-' to do some simple formatting*/
> - if (file_printf(ms, "\n- ") == -1)
> + /*
> + * If we are going to print something, we'll need to print
> + * a blank before we print something else.
> + */
> + if (magic[magindex].desc[0]) {
> + need_separator = 1;
> + if (print_sep(ms, firstline) == -1)
> return -1;
> }
>
> if ((ms->c.off[cont_level] = mprint(ms, &p, &magic[magindex]))
> == -1)
> return -1;
> - /*
> - * If we printed something, we'll need to print
> - * a blank before we print something else.
> - */
> - if (magic[magindex].desc[0])
> - need_separator = 1;
> +
> /* and any continuations that match */
> if (check_mem(ms, ++cont_level) == -1)
> return -1;
> @@ -189,6 +189,14 @@
> break;
> default:
> /*
> + * If we are going to print something,
> + * make sure that we have a separator first.
> + */
> + if (magic[magindex].desc[0]) {
> + if (print_sep(ms, firstline) == -1)
> + return -1;
> + }
> + /*
> * This continuation matched.
> * Print its message, with
> * a blank before it if
> @@ -249,7 +257,7 @@
> mprint(struct magic_set *ms, union VALUETYPE *p, struct magic *m)
> {
> uint32_t v;
> - int32_t t=0 ;
> + int32_t t = 0;
>
>
> switch (m->type) {
> @@ -1503,3 +1511,15 @@
>
> return matched;
> }
> +
> +private int
> +print_sep(struct magic_set *ms, int firstline)
> +{
> + if (firstline)
> + return 0;
> + /*
> + * we found another match
> + * put a newline and '-' to do some simple formatting
> + */
> + return file_printf(ms, "\n- ");
> +}
>
> _______________________________________________
> File mailing list
> File at mx.gw.com
> http://mx.gw.com/mailman/listinfo/file
--
Radek Vokál <rvokal at redhat.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://mx.gw.com/pipermail/file/attachments/20060509/4d200e5a/attachment.bin
More information about the File
mailing list