comparison lisp/process.el @ 410:de805c49cfc1 r21-2-35

Import from CVS: tag r21-2-35
author cvs
date Mon, 13 Aug 2007 11:19:21 +0200
parents 501cfd01ee6d
children 697ef44129c6
comparison
equal deleted inserted replaced
409:301b9ebbdf3b 410:de805c49cfc1
103 (progn 103 (progn
104 (when infile 104 (when infile
105 (setq infile (expand-file-name infile)) 105 (setq infile (expand-file-name infile))
106 (setq inbuf (generate-new-buffer "*call-process*")) 106 (setq inbuf (generate-new-buffer "*call-process*"))
107 (with-current-buffer inbuf 107 (with-current-buffer inbuf
108 (insert-file-contents-internal infile nil nil nil nil 108 ;; Make sure this works with jka-compr
109 coding-system-for-read))) 109 (let ((file-name-handler-alist nil))
110 (insert-file-contents-internal infile nil nil nil nil
111 'binary))))
110 (let ((stderr (if (consp buffer) (second buffer) t))) 112 (let ((stderr (if (consp buffer) (second buffer) t)))
111 (if (consp buffer) (setq buffer (car buffer))) 113 (if (consp buffer) (setq buffer (car buffer)))
112 (setq buffer 114 (setq buffer
113 (cond ((null buffer) nil) 115 (cond ((null buffer) nil)
114 ((eq buffer t) (current-buffer)) 116 ((eq buffer t) (current-buffer))
427 lost packets." 429 lost packets."
428 (open-network-stream-internal name buffer host service protocol)) 430 (open-network-stream-internal name buffer host service protocol))
429 431
430 (defun shell-quote-argument (argument) 432 (defun shell-quote-argument (argument)
431 "Quote an argument for passing as argument to an inferior shell." 433 "Quote an argument for passing as argument to an inferior shell."
432 (if (eq system-type 'windows-nt) 434 (if (and (eq system-type 'windows-nt)
433 (nt-quote-process-args (list shell-file-name argument)) 435 ;; #### this is a temporary hack. a better solution needs
436 ;; futzing with the c code. i'll do this shortly.
437 (let ((progname (downcase (file-name-nondirectory
438 shell-file-name))))
439 (or (equal progname "command.com")
440 (equal progname "cmd.exe"))))
441 argument
434 ;; Quote everything except POSIX filename characters. 442 ;; Quote everything except POSIX filename characters.
435 ;; This should be safe enough even for really weird shells. 443 ;; This should be safe enough even for really weird shells.
436 (let ((result "") (start 0) end) 444 (let ((result "") (start 0) end)
437 (while (string-match "[^-0-9a-zA-Z_./]" argument start) 445 (while (string-match "[^-0-9a-zA-Z_./]" argument start)
438 (setq end (match-beginning 0) 446 (setq end (match-beginning 0)