Op 13-09-16 om 14:29 schreef Greg Wooledge:
> On Tue, Sep 13, 2016 at 05:11:05AM +0200, Martijn Dekker wrote:
>> The command
>>
>>      kill -l 0
>>
>> outputs T. I would expect EXIT as T is not a valid signal or
>> pseudosignal name. Since T is the last letter of EXIT, I suspect a typo
>> somewhere.
> 
> My guess is it's just printing the string with the first 3 characters
> removed (SIGHUP -> HUP, SIGINT -> INT, EXIT -> T).
You're right. The fix is pretty simple, too. Patch attached.

- M.

diff --git a/builtins/common.c b/builtins/common.c
index b100ebe..2bfdf85 100644
--- a/builtins/common.c
+++ b/builtins/common.c
@@ -785,7 +785,7 @@ display_signal_list (list, forcecols)
 #if defined (JOB_CONTROL)
          /* POSIX.2 says that `kill -l signum' prints the signal name without
             the `SIG' prefix. */
-         printf ("%s\n", (this_shell_builtin == kill_builtin) ? name + 3 : 
name);
+         printf ("%s\n", (this_shell_builtin == kill_builtin && STREQN (name, 
"SIG", 3)) ? name + 3 : name);
 #else
          printf ("%s\n", name);
 #endif

Reply via email to