aboutsummaryrefslogtreecommitdiffhomepage
path: root/common.cpp
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2013-04-07 23:54:43 -0700
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2013-04-07 23:54:43 -0700
commitb8f34cdd35cfddb4573e6b1ccc8f063b840b6b54 (patch)
tree1114918a109579ad61cf437272080c5da1c5978b /common.cpp
parent993c02857948b45e5d17cc2696f347c73b3a450d (diff)
Teach case-insensitive completions about tildes. Fixes https://github.com/fish-shell/fish-shell/issues/647
Diffstat (limited to 'common.cpp')
-rw-r--r--common.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/common.cpp b/common.cpp
index 3fb64a24..75a44ceb 100644
--- a/common.cpp
+++ b/common.cpp
@@ -554,12 +554,8 @@ wchar_t *quote_end(const wchar_t *pos)
wcstring wsetlocale(int category, const wchar_t *locale)
{
- char *lang = NULL;
- if (locale)
- {
- lang = wcs2str(locale);
- }
- char * res = setlocale(category,lang);
+ char *lang = locale ? wcs2str(locale) : NULL;
+ char *res = setlocale(category, lang);
free(lang);
/*
@@ -572,7 +568,7 @@ wcstring wsetlocale(int category, const wchar_t *locale)
// U+23CE is the "return" character
omitted_newline_char = unicode ? L'\x23CE' : L'~';
-
+
if (!res)
return wcstring();
else