Changeset 843 for trunk/src/ash/bltin/test.c
- Timestamp:
- Feb 4, 2007, 1:09:12 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/ash/bltin/test.c
r809 r843 11 11 */ 12 12 13 #if ndef __sun__13 #ifdef HAVE_SYS_CDEFS_H 14 14 #include <sys/cdefs.h> 15 15 #endif … … 196 196 #ifdef HAVE_SETPROGNAME 197 197 setprogname(argv[0]); 198 #endif 198 #endif 199 199 if (strcmp(argv[0], "[") == 0) { 200 200 if (strcmp(argv[--argc], "]")) … … 292 292 if (t_lex(t_wp[1]), t_wp_op && t_wp_op->op_type == BINOP) { 293 293 return binop(); 294 } 294 } 295 295 296 296 return strlen(*t_wp) > 0; … … 309 309 if ((opnd2 = *++t_wp) == NULL) 310 310 syntax(op->op_text, "argument expected"); 311 311 312 312 switch (op->op_num) { 313 313 case STREQ: … … 369 369 #else 370 370 return 0; 371 #endif 371 #endif 372 372 case FILBDEV: 373 373 #ifdef S_ISBLK … … 375 375 #else 376 376 return 0; 377 #endif 377 #endif 378 378 case FILFIFO: 379 379 #ifdef S_ISFIFO … … 381 381 #else 382 382 return 0; 383 #endif 383 #endif 384 384 case FILSOCK: 385 385 #ifdef S_ISSOCK … … 387 387 #else 388 388 return 0; 389 #endif 389 #endif 390 390 case FILSYM: 391 391 return S_ISLNK(s.st_mode); … … 399 399 #else 400 400 return 0; 401 #endif 401 #endif 402 402 case FILGZ: 403 403 return s.st_size > (off_t)0; … … 450 450 if (strcmp(s, op->op_text) == 0) 451 451 return op->op_type == BINOP && 452 (t[0] != ')' || t[1] != '\0'); 452 (t[0] != ')' || t[1] != '\0'); 453 453 op++; 454 454 } … … 471 471 while (isspace((unsigned char)*p)) 472 472 p++; 473 473 474 474 if (*p) 475 475 error("%s: bad number", s);
Note:
See TracChangeset
for help on using the changeset viewer.