diff options
author | David Aspinall <da@inf.ed.ac.uk> | 2004-10-05 20:28:27 +0000 |
---|---|---|
committer | David Aspinall <da@inf.ed.ac.uk> | 2004-10-05 20:28:27 +0000 |
commit | cb1385e9079922c4289a849bc4c5131c331162ac (patch) | |
tree | 228866ddb5645e4299cf41c8d498b3eee6d93a83 | |
parent | a5046bbe03a6de639305f61e4c5bc5912bea7d8c (diff) |
Fix to `isa-shell-command-to-string' suggested by Jonathan S. Shapiro
-rw-r--r-- | isa/isabelle-system.el | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/isa/isabelle-system.el b/isa/isabelle-system.el index 4ca667a8..363e9424 100644 --- a/isa/isabelle-system.el +++ b/isa/isabelle-system.el @@ -86,11 +86,9 @@ with full path." (defun isa-shell-command-to-string (command) "Like shell-command-to-string except the last character is stripped." - ;; FIXME: sometimes the command may fail. This will usually cause PG - ;; to break. Bit of an effort to trap errors here, we would need - ;; to provide some advice to shell-command-to-string to retain result - ;; of call to call-process, and raise and error in case it failed. - (substring (shell-command-to-string command) 0 -1)) + (let ((s (shell-command-to-string command))) + (if (equal (length s) 0) s + (substring s -1)))) (defun isa-getenv (envvar &optional default) "Extract an environment variable setting using the `isatool' program. |