aboutsummaryrefslogtreecommitdiffhomepage
path: root/expand.cpp
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-01-30 02:23:58 -0800
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-01-30 02:23:58 -0800
commit79e0405f6a6e56c2430d5d74b6c150d0b5d0e2fe (patch)
tree913c2d75ae2937ad4a4cb87d6a1e10ad25626593 /expand.cpp
parent316f81119f24471882f2d394cd332bcc1312da4d (diff)
Yet more un-hallocing
Diffstat (limited to 'expand.cpp')
-rw-r--r--expand.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/expand.cpp b/expand.cpp
index cd678d8a..b0fbcf97 100644
--- a/expand.cpp
+++ b/expand.cpp
@@ -2585,7 +2585,7 @@ int expand_string( void *context,
}
*/
-wchar_t *expand_one( void *context, wchar_t *string, int flags )
+wchar_t *expand_one( void *context, const wchar_t *string, int flags )
{
std::vector<completion_t> l;
int res;
@@ -2595,8 +2595,8 @@ wchar_t *expand_one( void *context, wchar_t *string, int flags )
if( (!(flags & ACCEPT_INCOMPLETE)) && expand_is_clean( string ) )
{
- halloc_register( context, string );
- return string;
+ halloc_register( context, (void *)string );
+ return (wchar_t *)string;
}
// al_init( &l );
@@ -2625,5 +2625,17 @@ wchar_t *expand_one( void *context, wchar_t *string, int flags )
halloc_register( context, one );
return one;
}
+
+bool expand_one( wcstring &in, int flag ) {
+ bool result = false;
+ wchar_t *res = expand_one(NULL, in.c_str(), flag);
+ if (res) {
+ in = res;
+ free(res);
+ result = true;
+ }
+ return result;
+}
+