Tue Sep 1 00:35:30 2020 UTC ()
eat the sign, pointed out by uwe@


(christos)
diff -r1.13 -r1.14 src/external/historical/nawk/dist/tran.c

cvs diff -r1.13 -r1.14 src/external/historical/nawk/dist/tran.c (expand / switch to unified diff)

--- src/external/historical/nawk/dist/tran.c 2020/09/01 00:21:01 1.13
+++ src/external/historical/nawk/dist/tran.c 2020/09/01 00:35:29 1.14
@@ -394,26 +394,28 @@ char *setsval(Cell *vp, const char *s) / @@ -394,26 +394,28 @@ char *setsval(Cell *vp, const char *s) /
394 394
395 return(vp->sval); 395 return(vp->sval);
396} 396}
397 397
398static int checkstr(const char *s, const char *v) 398static int checkstr(const char *s, const char *v)
399{ 399{
400 while (*s && tolower((unsigned char)*s) == *v) 400 while (*s && tolower((unsigned char)*s) == *v)
401 s++, v++; 401 s++, v++;
402 return !(*s || *v); 402 return !(*s || *v);
403} 403}
404 404
405static int checkinfnan(const char *s) 405static int checkinfnan(const char *s)
406{ 406{
 407 if (*s == '+' || *s == '-')
 408 s++;
407 switch (tolower((unsigned char)*s)) { 409 switch (tolower((unsigned char)*s)) {
408 case 'i': 410 case 'i':
409 return checkstr(s, "inf") || checkstr(s, "infinity"); 411 return checkstr(s, "inf") || checkstr(s, "infinity");
410 case 'n': 412 case 'n':
411 return checkstr(s, "nan"); 413 return checkstr(s, "nan");
412 default: 414 default:
413 return 1; 415 return 1;
414 } 416 }
415} 417}
416 418
417Awkfloat getfval(Cell *vp) /* get float val of a Cell */ 419Awkfloat getfval(Cell *vp) /* get float val of a Cell */
418{ 420{
419 if ((vp->tval & (NUM | STR)) == 0) 421 if ((vp->tval & (NUM | STR)) == 0)