… | |
… | |
365 | src++; |
365 | src++; |
366 | } |
366 | } |
367 | *dest = '\0'; |
367 | *dest = '\0'; |
368 | } |
368 | } |
369 | |
369 | |
370 | const char * |
|
|
371 | strrstr (const char *haystack, const char *needle) |
|
|
372 | { |
|
|
373 | const char *lastneedle; |
|
|
374 | |
|
|
375 | lastneedle = NULL; |
|
|
376 | while ((haystack = strstr (haystack, needle)) != NULL) |
|
|
377 | { |
|
|
378 | lastneedle = haystack; |
|
|
379 | haystack++; |
|
|
380 | } |
|
|
381 | return lastneedle; |
|
|
382 | |
|
|
383 | } |
|
|
384 | |
|
|
385 | #define EOL_SIZE (sizeof("\n")-1) |
370 | #define EOL_SIZE (sizeof("\n")-1) |
386 | void |
371 | void |
387 | strip_endline (char *buf) |
372 | strip_endline (char *buf) |
388 | { |
373 | { |
389 | if (strlen (buf) < sizeof ("\n")) |
374 | if (strlen (buf) < sizeof ("\n")) |