# HG changeset patch # User Andreas Schwab # Date 1235139895 0 # Node ID c526d585a71540e38feed78885fef71423946f0d # Parent 328f4b370b74057b13e35701935fe0380ad355fb (command-line): Don't match an empty argument as an option. (command-line-1): Likewise. diff -r 328f4b370b74 -r c526d585a715 lisp/ChangeLog --- a/lisp/ChangeLog Fri Feb 20 12:36:50 2009 +0000 +++ b/lisp/ChangeLog Fri Feb 20 14:24:55 2009 +0000 @@ -1,3 +1,9 @@ +2009-02-20 Andreas Schwab + + * startup.el (command-line): Don't match an empty argument as an + option. + (command-line-1): Likewise. + 2009-02-20 Daniel Jensen (tiny change) * apropos.el (apropos-library): Check for null filename in load-history. diff -r 328f4b370b74 -r c526d585a715 lisp/startup.el --- a/lisp/startup.el Fri Feb 20 12:36:50 2009 +0000 +++ b/lisp/startup.el Fri Feb 20 14:24:55 2009 +0000 @@ -828,10 +828,10 @@ (orig-argi argi) argval) ;; Handle --OPTION=VALUE format. - (when (string-match "^\\(--[^=]*\\)=" argi) + (when (string-match "\\`\\(--[^=]*\\)=" argi) (setq argval (substring argi (match-end 0)) argi (match-string 1 argi))) - (unless (equal argi "--") + (when (string-match "\\`--." orig-argi) (let ((completion (try-completion argi longopts))) (if (eq completion t) (setq argi (substring argi 1)) @@ -2125,21 +2125,20 @@ (setq argi "") ;; Convert long options to ordinary options ;; and separate out an attached option argument into argval. - (when (string-match "^\\(--[^=]*\\)=" argi) + (when (string-match "\\`\\(--[^=]*\\)=" argi) (setq argval (substring argi (match-end 0)) argi (match-string 1 argi))) - (if (equal argi "--") - (setq completion nil) - (setq completion (try-completion argi longopts))) - (if (eq completion t) - (setq argi (substring argi 1)) - (if (stringp completion) - (let ((elt (assoc completion longopts))) - (or elt - (error "Option `%s' is ambiguous" argi)) - (setq argi (substring (car elt) 1))) - (setq argval nil - argi orig-argi)))) + (when (string-match "\\`--." orig-argi) + (setq completion (try-completion argi longopts)) + (if (eq completion t) + (setq argi (substring argi 1)) + (if (stringp completion) + (let ((elt (assoc completion longopts))) + (or elt + (error "Option `%s' is ambiguous" argi)) + (setq argi (substring (car elt) 1))) + (setq argval nil + argi orig-argi))))) ;; Execute the option. (cond ((setq tem (assoc argi command-switch-alist))