diff options
| author | Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> | 2026-03-26 12:53:53 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-26 12:53:53 +0100 |
| commit | 13e14a6bfd9f29cbfeab0c5161d2a994f97532e7 (patch) | |
| tree | 3aa7186fe092e42783dc7e981dc39a74ea61c466 /gl/strsep.c | |
| parent | 9d8503f90ef25b2cecd324dc118e441f40233ea8 (diff) | |
| download | monitoring-plugins-13e14a6bfd9f29cbfeab0c5161d2a994f97532e7.tar.gz | |
Update/gnulib 2026 03 (#2247)
* Sync with the 202601-stable Gnulib code (4a3650d887)
* Ignore more deps stuff in gnulib
* Remove autogenerated gnulib files
* Ignore more gnulib generated headers
Diffstat (limited to 'gl/strsep.c')
| -rw-r--r-- | gl/strsep.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gl/strsep.c b/gl/strsep.c index 5a489d11..6338c62d 100644 --- a/gl/strsep.c +++ b/gl/strsep.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* Copyright (C) 2004, 2007, 2009-2025 Free Software Foundation, Inc. | 1 | /* Copyright (C) 2004, 2007, 2009-2026 Free Software Foundation, Inc. |
| 2 | 2 | ||
| 3 | Written by Yoann Vandoorselaere <yoann@prelude-ids.org>. | 3 | Written by Yoann Vandoorselaere <yoann@prelude-ids.org>. |
| 4 | 4 | ||
| @@ -26,7 +26,6 @@ char * | |||
| 26 | strsep (char **stringp, const char *delim) | 26 | strsep (char **stringp, const char *delim) |
| 27 | { | 27 | { |
| 28 | char *start = *stringp; | 28 | char *start = *stringp; |
| 29 | char *ptr; | ||
| 30 | 29 | ||
| 31 | if (start == NULL) | 30 | if (start == NULL) |
| 32 | return NULL; | 31 | return NULL; |
| @@ -38,12 +37,14 @@ strsep (char **stringp, const char *delim) | |||
| 38 | return start; | 37 | return start; |
| 39 | } | 38 | } |
| 40 | 39 | ||
| 40 | char *ptr; | ||
| 41 | /* Optimize the case of one delimiter. */ | 41 | /* Optimize the case of one delimiter. */ |
| 42 | if (delim[1] == '\0') | 42 | if (delim[1] == '\0') |
| 43 | ptr = strchr (start, delim[0]); | 43 | ptr = strchr (start, delim[0]); |
| 44 | else | 44 | else |
| 45 | /* The general case. */ | 45 | /* The general case. */ |
| 46 | ptr = strpbrk (start, delim); | 46 | ptr = strpbrk (start, delim); |
| 47 | |||
| 47 | if (ptr == NULL) | 48 | if (ptr == NULL) |
| 48 | { | 49 | { |
| 49 | *stringp = NULL; | 50 | *stringp = NULL; |
