aboutsummaryrefslogtreecommitdiffhomepage
path: root/path.cpp
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-03-26 01:21:10 -0700
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-03-26 01:21:10 -0700
commit0bc644abf06d1cf903ed7bf59302894f80d18971 (patch)
treeda229cd4505d34800af22e10c8f61d380d6a88b3 /path.cpp
parent31b7d076b7bff8d7bb81e6a1fff58755b7baa10b (diff)
Fix lots of bugs related to the static analyzer
Improved how screen.cpp interacts with output_set_writer()
Diffstat (limited to 'path.cpp')
-rw-r--r--path.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/path.cpp b/path.cpp
index 1da92d7a..7580d46b 100644
--- a/path.cpp
+++ b/path.cpp
@@ -185,7 +185,6 @@ wchar_t *path_get_path( const wchar_t *cmd )
its arguments
*/
wchar_t *path_cpy = wcsdup( path.c_str() );
- const wchar_t *nxt_path = path.c_str();
wchar_t *state;
if( (new_cmd==0) || (path_cpy==0) )
@@ -193,7 +192,7 @@ wchar_t *path_get_path( const wchar_t *cmd )
DIE_MEM();
}
- for( nxt_path = wcstok( path_cpy, ARRAY_SEP_STR, &state );
+ for( const wchar_t *nxt_path = wcstok( path_cpy, ARRAY_SEP_STR, &state );
nxt_path != 0;
nxt_path = wcstok( 0, ARRAY_SEP_STR, &state) )
{
@@ -366,17 +365,15 @@ wchar_t *path_allocate_cdpath( const wchar_t *dir, const wchar_t *wd )
paths.push_back(path);
} else {
wchar_t *path_cpy;
- const wchar_t *nxt_path;
wchar_t *state;
wchar_t *whole_path;
env_var_t path = L".";
- nxt_path = path.c_str();
path_cpy = wcsdup( path.c_str() );
- for( nxt_path = wcstok( path_cpy, ARRAY_SEP_STR, &state );
- nxt_path != 0;
+ for( const wchar_t *nxt_path = wcstok( path_cpy, ARRAY_SEP_STR, &state );
+ nxt_path != NULL;
nxt_path = wcstok( 0, ARRAY_SEP_STR, &state) )
{
wchar_t *expanded_path = expand_tilde_compat( wcsdup(nxt_path) );