diff options
author | Björn Gustavsson <[email protected]> | 2014-02-20 12:06:03 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2014-02-20 12:06:03 +0100 |
commit | a1631b173c977b5903e26a2bed36f9b32fe5b4d5 (patch) | |
tree | 45cc29022e4fcc76f86aa3113c9c220768ba4286 /lib/stdlib/src | |
parent | 3cfcf1026418cbef3c1a35ebe8794eb99530e4ff (diff) | |
parent | cf72119ea1b76a8650503a8ca2b1e025e9c7b700 (diff) | |
download | otp-a1631b173c977b5903e26a2bed36f9b32fe5b4d5.tar.gz otp-a1631b173c977b5903e26a2bed36f9b32fe5b4d5.tar.bz2 otp-a1631b173c977b5903e26a2bed36f9b32fe5b4d5.zip |
Merge branch 'fenollp/shell-expand-0arity-completely'
* fenollp/shell-expand-0arity-completely:
Correct parenthesis expansion
Clean up edlin_expand_SUITE.erl to facilitate maintainance
Diffstat (limited to 'lib/stdlib/src')
-rw-r--r-- | lib/stdlib/src/edlin_expand.erl | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/lib/stdlib/src/edlin_expand.erl b/lib/stdlib/src/edlin_expand.erl index 0033010dce..a2b4663219 100644 --- a/lib/stdlib/src/edlin_expand.erl +++ b/lib/stdlib/src/edlin_expand.erl @@ -73,7 +73,7 @@ to_atom(Str) -> error end. -match(Prefix, Alts, Extra) -> +match(Prefix, Alts, Extra0) -> Len = length(Prefix), Matches = lists:sort( [{S, A} || {H, A} <- Alts, @@ -89,13 +89,11 @@ match(Prefix, Alts, Extra) -> {yes, Remain, []} end; {complete, Str} -> - {_, Arity} = lists:keyfind(Str, 1, Matches), - case {Arity, Extra} of - {0, "("} -> - {yes, nthtail(Len, Str) ++ "()", []}; - _ -> - {yes, nthtail(Len, Str) ++ Extra, []} - end; + Extra = case {Extra0,Matches} of + {"(",[{Str,0}]} -> "()"; + {_,_} -> Extra0 + end, + {yes, nthtail(Len, Str) ++ Extra, []}; no -> {no, [], []} end. |