diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2015-05-17 14:17:01 -0700 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2015-05-17 14:17:01 -0700 |
commit | 286c60bc9d1b692b650bd0c37a6da635e99f119f (patch) | |
tree | 0afbe223a384e7562e94b306a91d1f89ae724330 /common.cpp | |
parent | c26d317da5950645590fecf45c907f35ba0462bb (diff) |
Correctly handle mixing named arguments with function name
Before this fix, `function -a arg1 name1` would produce a
function named 'arg1'. After this fix, it will produce a
function named 'name'. See #2068 for more.
Diffstat (limited to 'common.cpp')
-rw-r--r-- | common.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -481,9 +481,14 @@ const wchar_t *wcsvarname(const wchar_t *str) return NULL; } -const wchar_t *wcsfuncname(const wchar_t *str) +const wchar_t *wcsvarname(const wcstring &str) { - return wcschr(str, L'/'); + return wcsvarname(str.c_str()); +} + +const wchar_t *wcsfuncname(const wcstring &str) +{ + return wcschr(str.c_str(), L'/'); } |