aboutsummaryrefslogtreecommitdiffhomepage
path: root/highlight.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 /highlight.cpp
parent316f81119f24471882f2d394cd332bcc1312da4d (diff)
Yet more un-hallocing
Diffstat (limited to 'highlight.cpp')
-rw-r--r--highlight.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/highlight.cpp b/highlight.cpp
index f0fbacea..8f7cbf88 100644
--- a/highlight.cpp
+++ b/highlight.cpp
@@ -605,11 +605,10 @@ void tokenize( const wchar_t * const buff, int * const color, const int pos, arr
if( cmd && (wcscmp( cmd, L"cd" ) == 0) )
{
- wchar_t *dir = expand_one( context,
- wcsdup(tok_last( &tok )),
- EXPAND_SKIP_CMDSUBST );
- if( dir )
+ wcstring dir_str = tok_last( &tok );
+ if (expand_one(dir_str, EXPAND_SKIP_CMDSUBST))
{
+ const wchar_t *dir = dir_str.c_str();
int is_long_help = wcsncmp(dir,L"--help", wcslen(dir) );
int is_short_help = wcsncmp(dir,L"-h", wcslen(dir) );