aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2005-10-10 21:24:29 +0000
committerRichard M. Stallman2005-10-10 21:24:29 +0000
commit17a3b6da975742dfaa02ebd52c031d9972eac2f9 (patch)
treef58b66036ef02d82968f4d29ade99cd83b3dd21f
parent58af55912424b29b7fc385bc506e2056bc25b2a6 (diff)
downloademacs-17a3b6da975742dfaa02ebd52c031d9972eac2f9.tar.gz
emacs-17a3b6da975742dfaa02ebd52c031d9972eac2f9.zip
(sh-tmp-file): Use mktemp.
-rw-r--r--lisp/ChangeLog4
-rw-r--r--lisp/progmodes/sh-script.el18
2 files changed, 17 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 83281d5a321..147cf2afa4d 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,7 @@
12005-10-10 Emanuele Giaquinta <emanuele.giaquinta@gmail.com>
2
3 * progmodes/sh-script.el (sh-tmp-file): Use mktemp.
4
12005-10-10 Karl Chen <quarl@cs.berkeley.edu> 52005-10-10 Karl Chen <quarl@cs.berkeley.edu>
2 6
3 * jka-cmpr-hook.el (jka-compr-handler): Fix typo in `operations' prop. 7 * jka-cmpr-hook.el (jka-compr-handler): Fix typo in `operations' prop.
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el
index 8af9b637b0b..ee184e42446 100644
--- a/lisp/progmodes/sh-script.el
+++ b/lisp/progmodes/sh-script.el
@@ -3392,16 +3392,20 @@ t means to return a list of all possible completions of STRING.
3392 "Insert code to setup temporary file handling. See `sh-feature'." 3392 "Insert code to setup temporary file handling. See `sh-feature'."
3393 (bash sh-append ksh88) 3393 (bash sh-append ksh88)
3394 (csh (file-name-nondirectory (buffer-file-name)) 3394 (csh (file-name-nondirectory (buffer-file-name))
3395 "set tmp = /tmp/" str ".$$" \n 3395 "set tmp = `mktemp /tmp/" str ".XXXXXX`" \n
3396 "onintr exit" \n _ 3396 "onintr exit" \n _
3397 (and (goto-char (point-max)) 3397 (and (goto-char (point-max))
3398 (not (bolp)) 3398 (not (bolp))
3399 ?\n) 3399 ?\n)
3400 "exit:\n" 3400 "exit:\n"
3401 "rm $tmp* >&/dev/null" > \n) 3401 "rm $tmp* >&/dev/null" > \n)
3402 ;; The change to use mktemp here has not been tested;
3403 ;; I don't know es syntax, so I had to guess.
3404 ;; If you try it, or if you know es syntax and can check it,
3405 ;; please tell me whether it needs any change. --rms.
3402 (es (file-name-nondirectory (buffer-file-name)) 3406 (es (file-name-nondirectory (buffer-file-name))
3403 > "local( signals = $signals sighup sigint; tmp = /tmp/" str 3407 > "local( signals = $signals sighup sigint; tmp = `mktemp /tmp/" str
3404 ".$pid ) {" \n 3408 ".XXXXXX` ) {" \n
3405 > "catch @ e {" \n 3409 > "catch @ e {" \n
3406 > "rm $tmp^* >[2]/dev/null" \n 3410 > "rm $tmp^* >[2]/dev/null" \n
3407 "throw $e" \n 3411 "throw $e" \n
@@ -3411,11 +3415,15 @@ t means to return a list of all possible completions of STRING.
3411 ?\} > \n) 3415 ?\} > \n)
3412 (ksh88 sh-modify sh 3416 (ksh88 sh-modify sh
3413 7 "EXIT") 3417 7 "EXIT")
3418 ;; The change to use mktemp here has not been tested;
3419 ;; I don't know rc syntax, so I had to guess.
3420 ;; If you try it, or if you know rc syntax and can check it,
3421 ;; please tell me whether it needs any change. --rms.
3414 (rc (file-name-nondirectory (buffer-file-name)) 3422 (rc (file-name-nondirectory (buffer-file-name))
3415 > "tmp = /tmp/" str ".$pid" \n 3423 > "tmp = `mktemp /tmp/" str ".XXXXXX`" \n
3416 "fn sigexit { rm $tmp^* >[2]/dev/null }" \n) 3424 "fn sigexit { rm $tmp^* >[2]/dev/null }" \n)
3417 (sh (file-name-nondirectory (buffer-file-name)) 3425 (sh (file-name-nondirectory (buffer-file-name))
3418 > "TMP=${TMPDIR:-/tmp}/" str ".$$" \n 3426 > "TMP=`mktemp ${TMPDIR:-/tmp}/" str ".XXXXXX`" \n
3419 "trap \"rm $TMP* 2>/dev/null\" " ?0 \n)) 3427 "trap \"rm $TMP* 2>/dev/null\" " ?0 \n))
3420 3428
3421 3429