Rev 8861 | Rev 8880 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 8861 | Rev 8863 | ||
---|---|---|---|
Line 328... | Line 328... | ||
328 | if(*p==0) return p; |
328 | if(*p==0) return p; |
329 | for(pp=p+strlen(p)-1; pp>=p && myisspace(*pp); pp--); |
329 | for(pp=p+strlen(p)-1; pp>=p && myisspace(*pp); pp--); |
330 | if(pp[1]) pp[1]=0; return pp; |
330 | if(pp[1]) pp[1]=0; return pp; |
331 | } |
331 | } |
332 | 332 | ||
- | 333 | /* strip trailing spaces; return string end. */ |
|
- | 334 | char *strip_trailing_spaces2(char *p) |
|
- | 335 | { |
|
- | 336 | char *pp; |
|
- | 337 | if(*p==0) return p; |
|
- | 338 | for(pp=p+strlen(p)-1; pp>=p && isspace(*pp); *(pp--)=0); |
|
- | 339 | return pp; |
|
- | 340 | } |
|
- | 341 | ||
333 |
|
342 | /* Routines for quick search of item in a list. */ |
334 | 343 | ||
335 | /* Verify whether a list is well-ordered. For debugging uses. |
344 | /* Verify whether a list is well-ordered. For debugging uses. |
336 | * Returns 0 if order is OK, -1 otherwise. */ |
345 | * Returns 0 if order is OK, -1 otherwise. */ |
337 | int verify_order(void *list, int items, size_t item_size) |
346 | int verify_order(void *list, int items, size_t item_size) |
338 | { |
347 | { |