- Timestamp:
- Sep 5, 2008 5:06:31 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kmk/kmkbuiltin/expr.c
r1708 r1739 14 14 #ifdef KMK_WITH_REGEX 15 15 #include <regex.h> 16 #endif 16 #endif 17 17 #include <setjmp.h> 18 18 #include <assert.h> … … 248 248 av++; 249 249 250 250 251 251 if (pat == 0 && p[0] != '\0') { 252 252 if (p[1] == '\0') { … … 318 318 char errbuf[256]; 319 319 int eval; 320 struct val * l, *r;320 struct val *r; 321 321 struct val *v; 322 #endif 323 struct val *l; 322 324 323 325 l = eval6(); 324 326 while (token == MATCH) { 327 #ifdef KMK_WITH_REGEX 325 328 nexttoken(1); 326 329 r = eval6(); … … 360 363 361 364 l = v; 365 #else 366 longjmp(g_expr_jmp, errx(2, "regex not supported, sorry.")); 367 #endif 362 368 } 363 369 364 370 return l; 365 #else366 longjmp(g_expr_jmp, errx(2, "regex not supported, sorry."));367 #endif368 371 } 369 372 … … 575 578 nexttoken(0); 576 579 vp = eval0(); 577 580 578 581 if (token != EOI) { 579 582 error(); 580 583 /* NOTREACHED */ 581 584 } 582 585 583 586 if (vp->type == integer) 584 587 printf("%d\n", vp->u.i); 585 588 else 586 589 printf("%s\n", vp->u.s); 587 590 588 591 rval = is_zero_or_null(vp); 589 } 592 } 590 593 /* else: longjmp */ 591 594
Note:
See TracChangeset
for help on using the changeset viewer.