diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2012-12-22 12:20:41 -0800 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2012-12-22 12:20:41 -0800 |
commit | 8a66ba6c359d0a64419e7182efee1af040d5e092 (patch) | |
tree | 562de6c982b8382a51d78a40a1ab705fefa47099 /builtin.cpp | |
parent | d6b5558cf2932ac32ddbc6c49482761b53765c6b (diff) | |
parent | 8a446f43ff184fad6f7aeca05fca51bb3aac2d91 (diff) |
Merge branch 'event-bug-test' of git://github.com/JanKanis/fish-shell into JanKanis-event-bug-test
Diffstat (limited to 'builtin.cpp')
-rw-r--r-- | builtin.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/builtin.cpp b/builtin.cpp index ae587e18..708f761e 100644 --- a/builtin.cpp +++ b/builtin.cpp @@ -1009,15 +1009,15 @@ static int builtin_emit(parser_t &parser, wchar_t **argv) } - for (; woptind < argc; woptind++) - { - event_fire_generic(argv[woptind]); + if(!argv[woptind]) { + append_format(stderr_buffer, L"%ls: expected event name\n", argv[0]); + return STATUS_BUILTIN_ERROR; } + wchar_t *eventname = argv[woptind]; + wcstring_list_t args(argv + woptind + 1, argv + argc); + event_fire_generic(eventname, &args); return STATUS_BUILTIN_OK; - - - } @@ -1099,7 +1099,7 @@ static void functions_def(const wcstring &name, wcstring &out) search.function_name = name; std::vector<event_t *> ev; - event_get(&search, &ev); + event_get(search, &ev); out.append(L"function "); |