search for: is_number

Displaying 8 results from an estimated 8 matches for "is_number".

Did you mean: ip_number
2019 Jan 25
0
[klibc:update-dash] [JOBS] Fix off-by-one error for multiple of four job numbers
...> Signed-off-by: Ben Hutchings <ben at decadent.org.uk> --- usr/dash/jobs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr/dash/jobs.c b/usr/dash/jobs.c index 009bbfee..1c6c6fbd 100644 --- a/usr/dash/jobs.c +++ b/usr/dash/jobs.c @@ -698,7 +698,7 @@ check: if (is_number(p)) { num = atoi(p); - if (num < njobs) { + if (num <= njobs) { jp = jobtab + num - 1; if (jp->used) goto gotit;
2019 Jan 25
0
[klibc:update-dash] jobs: Don't attempt to access job table for job %0
...> Signed-off-by: Ben Hutchings <ben at decadent.org.uk> --- usr/dash/jobs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr/dash/jobs.c b/usr/dash/jobs.c index 1c6c6fbd..7c324b76 100644 --- a/usr/dash/jobs.c +++ b/usr/dash/jobs.c @@ -698,7 +698,7 @@ check: if (is_number(p)) { num = atoi(p); - if (num <= njobs) { + if (num > 0 && num <= njobs) { jp = jobtab + num - 1; if (jp->used) goto gotit;
2019 Jan 25
0
[klibc:update-dash] trap: Implement POSIX.1-2008 trap reset behaviour
...0; } - if (!ap[1]) + if (!ap[1] || decode_signum(*ap) >= 0) action = NULL; else action = *ap++; @@ -399,18 +401,27 @@ out: /* NOTREACHED */ } -int decode_signal(const char *string, int minsig) +static int decode_signum(const char *string) { - int signo; + int signo = -1; if (is_number(string)) { signo = atoi(string); - if (signo >= NSIG) { - return -1; - } - return signo; + if (signo >= NSIG) + signo = -1; } + return signo; +} + +int decode_signal(const char *string, int minsig) +{ + int signo; + + signo = decode_signum(string); + if (signo >= 0) + retur...
2020 Mar 28
0
[klibc:update-dash] dash: jobs: Don't attempt to access job table for job %0
...> Signed-off-by: Ben Hutchings <ben at decadent.org.uk> --- usr/dash/jobs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr/dash/jobs.c b/usr/dash/jobs.c index c9b631ac..49c14441 100644 --- a/usr/dash/jobs.c +++ b/usr/dash/jobs.c @@ -698,7 +698,7 @@ check: if (is_number(p)) { num = atoi(p); - if (num <= njobs) { + if (num > 0 && num <= njobs) { jp = jobtab + num - 1; if (jp->used) goto gotit;
2020 Mar 28
0
[klibc:update-dash] dash: trap: Implement POSIX.1-2008 trap reset behaviour
...0; } - if (!ap[1]) + if (!ap[1] || decode_signum(*ap) >= 0) action = NULL; else action = *ap++; @@ -399,18 +401,27 @@ out: /* NOTREACHED */ } -int decode_signal(const char *string, int minsig) +static int decode_signum(const char *string) { - int signo; + int signo = -1; if (is_number(string)) { signo = atoi(string); - if (signo >= NSIG) { - return -1; - } - return signo; + if (signo >= NSIG) + signo = -1; } + return signo; +} + +int decode_signal(const char *string, int minsig) +{ + int signo; + + signo = decode_signum(string); + if (signo >= 0) + retur...
2020 Mar 28
0
[klibc:update-dash] dash: [JOBS] Fix off-by-one error for multiple of four job numbers
...> Signed-off-by: Ben Hutchings <ben at decadent.org.uk> --- usr/dash/jobs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr/dash/jobs.c b/usr/dash/jobs.c index b9ff1402..c9b631ac 100644 --- a/usr/dash/jobs.c +++ b/usr/dash/jobs.c @@ -698,7 +698,7 @@ check: if (is_number(p)) { num = atoi(p); - if (num < njobs) { + if (num <= njobs) { jp = jobtab + num - 1; if (jp->used) goto gotit;
2019 Jan 25
0
[klibc:update-dash] dash: Fix some cosmetic differences from upstream dash
...str; } diff --git a/usr/dash/trap.c b/usr/dash/trap.c index 1e2a8677..182fa7ac 100644 --- a/usr/dash/trap.c +++ b/usr/dash/trap.c @@ -395,48 +395,45 @@ out: /* NOTREACHED */ } -/* - * Decode a signal name - */ int decode_signal(const char *string, int minsig) { - int i; + int signo; if (is_number(string)) { - i = atoi(string); - if (i >= NSIG) { + signo = atoi(string); + if (signo >= NSIG) { return -1; } - return i; + return signo; } - for ( i = minsig ; i < NSIG ; i++ ) { - if ( sys_sigabbrev[i] && - !strcasecmp(string, sys_sigabbrev[i]) ) - retur...
2020 Mar 28
0
[klibc:update-dash] dash: Fix some cosmetic differences from upstream dash
...str; } diff --git a/usr/dash/trap.c b/usr/dash/trap.c index 1e2a8677..182fa7ac 100644 --- a/usr/dash/trap.c +++ b/usr/dash/trap.c @@ -395,48 +395,45 @@ out: /* NOTREACHED */ } -/* - * Decode a signal name - */ int decode_signal(const char *string, int minsig) { - int i; + int signo; if (is_number(string)) { - i = atoi(string); - if (i >= NSIG) { + signo = atoi(string); + if (signo >= NSIG) { return -1; } - return i; + return signo; } - for ( i = minsig ; i < NSIG ; i++ ) { - if ( sys_sigabbrev[i] && - !strcasecmp(string, sys_sigabbrev[i]) ) - retur...