aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Schwab2009-02-20 14:24:55 +0000
committerAndreas Schwab2009-02-20 14:24:55 +0000
commit7b704afe99c01110ff3fa7d5d534ea61fc112f3c (patch)
treeb5e2247f163b947be886497248008ec81b52d3cd
parent867d4bb3718f1fee9191e2c17cd810ef620d4b54 (diff)
downloademacs-7b704afe99c01110ff3fa7d5d534ea61fc112f3c.tar.gz
emacs-7b704afe99c01110ff3fa7d5d534ea61fc112f3c.zip
(command-line): Don't match an empty argument as an
option. (command-line-1): Likewise.
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/startup.el29
2 files changed, 20 insertions, 15 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 2bf46c5aa38..9064658ab96 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
12009-02-20 Andreas Schwab <schwab@suse.de>
2
3 * startup.el (command-line): Don't match an empty argument as an
4 option.
5 (command-line-1): Likewise.
6
12009-02-20 Daniel Jensen <daniel@bigwalter.net> (tiny change) 72009-02-20 Daniel Jensen <daniel@bigwalter.net> (tiny change)
2 8
3 * apropos.el (apropos-library): Check for null filename in load-history. 9 * apropos.el (apropos-library): Check for null filename in load-history.
diff --git a/lisp/startup.el b/lisp/startup.el
index 22a9fa02103..7a1f9dc392d 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -828,10 +828,10 @@ opening the first frame (e.g. open a connection to an X server).")
828 (orig-argi argi) 828 (orig-argi argi)
829 argval) 829 argval)
830 ;; Handle --OPTION=VALUE format. 830 ;; Handle --OPTION=VALUE format.
831 (when (string-match "^\\(--[^=]*\\)=" argi) 831 (when (string-match "\\`\\(--[^=]*\\)=" argi)
832 (setq argval (substring argi (match-end 0)) 832 (setq argval (substring argi (match-end 0))
833 argi (match-string 1 argi))) 833 argi (match-string 1 argi)))
834 (unless (equal argi "--") 834 (when (string-match "\\`--." orig-argi)
835 (let ((completion (try-completion argi longopts))) 835 (let ((completion (try-completion argi longopts)))
836 (if (eq completion t) 836 (if (eq completion t)
837 (setq argi (substring argi 1)) 837 (setq argi (substring argi 1))
@@ -2125,21 +2125,20 @@ A fancy display is used on graphic displays, normal otherwise."
2125 (setq argi "") 2125 (setq argi "")
2126 ;; Convert long options to ordinary options 2126 ;; Convert long options to ordinary options
2127 ;; and separate out an attached option argument into argval. 2127 ;; and separate out an attached option argument into argval.
2128 (when (string-match "^\\(--[^=]*\\)=" argi) 2128 (when (string-match "\\`\\(--[^=]*\\)=" argi)
2129 (setq argval (substring argi (match-end 0)) 2129 (setq argval (substring argi (match-end 0))
2130 argi (match-string 1 argi))) 2130 argi (match-string 1 argi)))
2131 (if (equal argi "--") 2131 (when (string-match "\\`--." orig-argi)
2132 (setq completion nil) 2132 (setq completion (try-completion argi longopts))
2133 (setq completion (try-completion argi longopts))) 2133 (if (eq completion t)
2134 (if (eq completion t) 2134 (setq argi (substring argi 1))
2135 (setq argi (substring argi 1)) 2135 (if (stringp completion)
2136 (if (stringp completion) 2136 (let ((elt (assoc completion longopts)))
2137 (let ((elt (assoc completion longopts))) 2137 (or elt
2138 (or elt 2138 (error "Option `%s' is ambiguous" argi))
2139 (error "Option `%s' is ambiguous" argi)) 2139 (setq argi (substring (car elt) 1)))
2140 (setq argi (substring (car elt) 1))) 2140 (setq argval nil
2141 (setq argval nil 2141 argi orig-argi)))))
2142 argi orig-argi))))
2143 2142
2144 ;; Execute the option. 2143 ;; Execute the option.
2145 (cond ((setq tem (assoc argi command-switch-alist)) 2144 (cond ((setq tem (assoc argi command-switch-alist))