diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2012-05-17 19:46:08 -0700 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2012-05-17 19:46:08 -0700 |
commit | da6295c428271e34a9e03ce7858e12a2892dff44 (patch) | |
tree | 06075412bff755876a706ee17a336b8666f37b65 /builtin.cpp | |
parent | 86645b32e172301088517bfb860b2e0990b3e5ec (diff) |
More work towards getting function.h off of shared_ptr
Diffstat (limited to 'builtin.cpp')
-rw-r--r-- | builtin.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/builtin.cpp b/builtin.cpp index fa187a17..d26cefb0 100644 --- a/builtin.cpp +++ b/builtin.cpp @@ -1085,8 +1085,8 @@ static int builtin_generic( parser_t &parser, wchar_t **argv ) */ static void functions_def( const wcstring &name, wcstring &out ) { - const wchar_t *desc = function_get_desc( name ); - wcstring def; + wcstring desc, def; + function_get_desc(name, &desc); function_get_definition(name, &def); event_t search(EVENT_ANY); @@ -1099,13 +1099,11 @@ static void functions_def( const wcstring &name, wcstring &out ) out.append(L"function "); out.append(name); - if( desc && wcslen(desc) ) + if (! desc.empty()) { - wchar_t *esc_desc = escape( desc, 1 ); - + wcstring esc_desc = escape_string(desc, true); out.append(L" --description "); - out.append( esc_desc ); - free( esc_desc ); + out.append(esc_desc); } if( !function_get_shadows( name ) ) |