Changes in master Modified lisp/org-mobile.el diff --git a/lisp/org-mobile.el b/lisp/org-mobile.el index 83462f0..fa1d4f4 100644 --- a/lisp/org-mobile.el +++ b/lisp/org-mobile.el @@ -472,6 +472,12 @@ agenda view showing the flagged items." target-file) (org-mobile-cleanup-encryption-tempfile)))) +(defun org-mobile-copy-file (file newname) + "Copy file, converting to Unix line endings." + (with-temp-file newname + (set-buffer-file-coding-system 'undecided-unix nil) + (insert-file-contents file))) + (defun org-mobile-copy-agenda-files () "Copy all agenda files to the stage or WebDAV directory." (let ((files-alist org-mobile-files-alist) @@ -485,7 +491,7 @@ agenda view showing the flagged items." (make-directory target-dir 'parents)) (if org-mobile-use-encryption (org-mobile-encrypt-and-move file target-path) - (copy-file file target-path 'ok-if-exists)) + (org-mobile-copy-file file target-path)) (setq check (shell-command-to-string (concat org-mobile-checksum-binary " " (shell-quote-argument (expand-file-name file))))) @@ -710,12 +716,15 @@ encryption program does not understand them." (defun org-mobile-encrypt-file (infile outfile) "Encrypt INFILE to OUTFILE, using `org-mobile-encryption-password'." - (shell-command - (format "openssl enc -aes-256-cbc -salt -pass %s -in %s -out %s" - (shell-quote-argument (concat "pass:" - (org-mobile-encryption-password))) - (shell-quote-argument (expand-file-name infile)) - (shell-quote-argument (expand-file-name outfile))))) + (let ((tempfile (make-temp-file "orgmobile"))) + (org-mobile-copy-file infile tempfile) + (shell-command + (format "openssl enc -aes-256-cbc -salt -pass %s -in %s -out %s" + (shell-quote-argument (concat "pass:" + (org-mobile-encryption-password))) + (shell-quote-argument (expand-file-name tempfile)) + (shell-quote-argument (expand-file-name outfile)))) + (delete-file tempfile))) (defun org-mobile-decrypt-file (infile outfile) "Decrypt INFILE to OUTFILE, using `org-mobile-encryption-password'."