[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Gettext po-mode.el: fix "po-validate" if there are whitespace charac
From: |
Bruno Haible |
Subject: |
Re: Gettext po-mode.el: fix "po-validate" if there are whitespace characters in file path |
Date: |
Sun, 17 Jun 2007 23:24:54 +0200 |
User-agent: |
KMail/1.5.4 |
Hello,
Laurynas Biveinis wrote:
> Currently "po-validate" command is broken if the path to the
> translation file being validated contains whitespace. It seems that
> the reason for it is that file name is passed without any quoting.
Indeed, you're right. Thanks for reporting this.
> I'm no elisp expert, but with this tiny patch po-validate starts working
> again.
I'm not an elisp expert either, but I found that both GNU Emacs and XEmacs
have a function called 'shell-quote-argument', that works as well (and also
works in the case that the filename itself contains a double-quote). I'm
applying this patch:
2007-06-17 Bruno Haible <address@hidden>
* po-mode.el (po-validate): Protect the buffer-file-name against
shell interpretation.
Reported by Laurynas Biveinis <address@hidden>.
*** po-mode.el 25 May 2007 00:20:17 -0000 1.6
--- po-mode.el 17 Jun 2007 21:18:44 -0000
***************
*** 3123,3130 ****
(function (lambda (mode-name)
(concat "*" mode-name " validation*"))))
(compile-command (concat po-msgfmt-program
! " --statistics -c -v -o " dev-null " "
! buffer-file-name)))
(po-msgfmt-version-check)
(compile compile-command)))
--- 3123,3130 ----
(function (lambda (mode-name)
(concat "*" mode-name " validation*"))))
(compile-command (concat po-msgfmt-program
! " --statistics -c -v -o " dev-null " "
! (shell-quote-argument buffer-file-name))))
(po-msgfmt-version-check)
(compile compile-command)))