>>> -          (setq ret (shell-command command nil))
>>> +          (setq ret (call-process shell-file-name nil nil nil "-c" 
>>> command))
>>> (if (not (= 0 ret))
>>> (error "Could not resize image")))
>>> (copy-file file new-file t))
>> 
>> BTW, I strongly suspect that the above can suffer from quoting problems if
>> `new-file' happens to contain spaces or quotes.

> Well it could, if you change the default value of
> `tumme-cmd-create-temp-image-options' too much:

> (defcustom tumme-cmd-create-temp-image-options
>   "%p -size %wx%h \"%f\" -resize %wx%h +profile \"*\" jpeg:\"%t\""
>   "*Format of command used to create temporary image for display window.
> Available options are %p which is replaced by
> `tumme-cmd-create-temp-image-program', %w and %h which is replaced by
> the calculated max size for width and height in the image display window,
> %f which is replaced by the file name of the original image and %t which
> is replaced by the file name of the temporary file."
>   :type 'string
>   :group 'tumme)

> See those \" around %f and %t? They are supposed to take care of the
> problem you mention (at least spaces, I am not so sure about
> quotes). 

I *am* sure about quotes.  E.g. if

   %f

is replaced by a file name such as

   a"; rm -rf ~/.;"

you may even get a nasty surprise.


        Stefan


_______________________________________________
emacs-pretest-bug mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug

Reply via email to