diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2012-11-21 22:23:48 -0800 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2012-11-21 22:23:48 -0800 |
commit | 6fc9e6f21ed8e6ebc2c6254426d1dc33f6bce636 (patch) | |
tree | 9bc04fd96159a2c86cd1b90d0b7fc80568ea8424 /builtin.cpp | |
parent | 7117c4a5ee4ebcdaa8ff692b9cc18fb87e6d8038 (diff) |
Make tok_first return a wcstring instead of a wchar_t*
Diffstat (limited to 'builtin.cpp')
-rw-r--r-- | builtin.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/builtin.cpp b/builtin.cpp index 6229eaeb..af0da328 100644 --- a/builtin.cpp +++ b/builtin.cpp @@ -3254,10 +3254,9 @@ static int builtin_fg(parser_t &parser, wchar_t **argv) j->command_wcstr()); } - wchar_t *ft = tok_first(j->command_wcstr()); - if (ft != 0) - env_set(L"_", ft, ENV_EXPORT); - free(ft); + const wcstring ft = tok_first(j->command_wcstr()); + if (! ft.empty()) + env_set(L"_", ft.c_str(), ENV_EXPORT); reader_write_title(); make_first(j); |