Changeset 280 for branches/GNU/src/gmake/misc.c
- Timestamp:
- May 16, 2005, 6:54:02 PM (20 years ago)
- Location:
- branches/GNU/src/gmake
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GNU/src/gmake
- Property svn:ignore
-
old new 34 34 README.DOS 35 35 README.W32 36 README.OS2 36 37 aclocal.m4 37 38 autom4te.cache
-
- Property svn:ignore
-
branches/GNU/src/gmake/misc.c
r153 r280 419 419 420 420 421 /* Search string BIG (length BLEN) for an occurrence of422 string SMALL (length SLEN). Return a pointer to the423 beginning of the first occurrence, or return nil if none found. */424 425 char *426 sindex (const char *big, unsigned int blen,427 const char *small, unsigned int slen)428 {429 if (!blen)430 blen = strlen (big);431 if (!slen)432 slen = strlen (small);433 434 if (slen && blen >= slen)435 {436 register unsigned int b;437 438 /* Quit when there's not enough room left for the small string. */439 --slen;440 blen -= slen;441 442 for (b = 0; b < blen; ++b, ++big)443 if (*big == *small && strneq (big + 1, small + 1, slen))444 return (char *)big;445 }446 447 return 0;448 }449 421 450 422 /* Limited INDEX: … … 468 440 469 441 char * 470 end_of_token (c har *s)442 end_of_token (const char *s) 471 443 { 472 444 while (*s != '\0' && !isblank ((unsigned char)*s)) 473 445 ++s; 474 return s;446 return (char *)s; 475 447 } 476 448 … … 563 535 564 536 537 /* Free a chain of `struct nameseq'. Each nameseq->name is freed 538 as well. Can be used on `struct dep' chains.*/ 539 540 void 541 free_ns_chain (struct nameseq *n) 542 { 543 register struct nameseq *tmp; 544 545 while (n != 0) 546 { 547 if (n->name != 0) 548 free (n->name); 549 550 tmp = n; 551 552 n = n->next; 553 554 free (tmp); 555 } 556 557 } 558 565 559 #ifdef iAPX286 566 560 /* The losing compiler on this machine can't handle this macro. */
Note:
See TracChangeset
for help on using the changeset viewer.