diff --git a/gensigs.sh b/gensigs.sh index fcd9e5a..b39aefd 100644 --- a/gensigs.sh +++ b/gensigs.sh @@ -1,11 +1,11 @@ #!/bin/sh -# $MirOS: src/bin/mksh/gensigs.sh,v 1.1 2005/05/23 12:01:09 tg Exp $ +# $MirOS: src/bin/mksh/gensigs.sh,v 1.2 2005/05/23 12:06:39 tg Exp $ echo '#include ' | $CC -E -dD -D_ANSI_SOURCE - \ | grep '[ ]SIG[A-Z0-9]*[ ]' \ | sed 's/^\(.*[ ]SIG\)\([A-Z0-9]*\)\([ ].*\)$/\2/' \ | while read name; do ( echo '#include '; echo "__mksh_test: SIG$name" ) \ - | $CC -E - | fgrep __mksh_test: \ - | sed 's/^__mksh_test: \([0-9]*\).*$/ { \1, "'$name'" },/' + | $CC -E - | fgrep __mksh_test: | sed \ + 's/^__mksh_test: \([0-9]*\).*$/ { \1, "'$name'" },/' done | fgrep -v '{ ,' >signames.inc diff --git a/histrap.c b/histrap.c index 0fde320..3fba625 100644 --- a/histrap.c +++ b/histrap.c @@ -1,4 +1,4 @@ -/** $MirOS: src/bin/mksh/histrap.c,v 1.2 2005/05/23 12:01:09 tg Exp $ */ +/** $MirOS: src/bin/mksh/histrap.c,v 1.3 2005/05/23 12:06:39 tg Exp $ */ /* $OpenBSD: history.c,v 1.30 2005/03/30 17:16:37 deraadt Exp $ */ /* $OpenBSD: trap.c,v 1.22 2005/03/30 17:16:37 deraadt Exp $ */ @@ -8,7 +8,7 @@ #include #include -__RCSID("$MirOS: src/bin/mksh/histrap.c,v 1.2 2005/05/23 12:01:09 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/histrap.c,v 1.3 2005/05/23 12:06:39 tg Exp $"); static int histfd; static int hsize; @@ -968,19 +968,17 @@ sprinkle(int fd) } #ifdef NEED_MKSH_SIGNAME - -struct _mksh_sigpair { - int nr; - const char *name; -} mksh_sigpair[] = { -#include "signames.inc" - { 0, NULL } -}; - static const char * const mksh_signame(int s) { int i = 0; + static const struct _mksh_sigpair { + int nr; + const char *name; + } const mksh_sigpair[] = { +#include "signames.inc" + { 0, NULL } + }; while (mksh_sigpair[i].name != NULL) { if (mksh_sigpair[i].nr == s)