org-mobile.org: Properly escape checksum binary path

* lisp/org-mobile.org (org-mobile-copy-agenda-files): Escape org-mobile-checksum-binary.

Fix a bug where if the checksum binary is in a non shell-safe path, then
the shell invocation silently fails. This can happen on any platform but
is probably worst on Windows where it's common to put programs in
"C:/Program Files".

TINYCHANGE
This commit is contained in:
Jacob Matthews 2015-04-07 12:52:25 -05:00 committed by Nicolas Goaziou
parent 19a7d6864d
commit d0bb993f70
1 changed files with 2 additions and 1 deletions

View File

@ -501,7 +501,8 @@ agenda view showing the flagged items."
(org-mobile-encrypt-and-move file target-path)
(copy-file file target-path 'ok-if-exists))
(setq check (shell-command-to-string
(concat org-mobile-checksum-binary " "
(concat (shell-quote-argument org-mobile-checksum-binary)
" "
(shell-quote-argument (expand-file-name file)))))
(when (string-match "[a-fA-F0-9]\\{30,40\\}" check)
(push (cons link-name (match-string 0 check))