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/stripslash.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/stripslash.c')
| -rw-r--r-- | gl/stripslash.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/gl/stripslash.c b/gl/stripslash.c index d5b07bca..8f8c38e3 100644 --- a/gl/stripslash.c +++ b/gl/stripslash.c | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* stripslash.c -- remove redundant trailing slashes from a file name | 1 | /* stripslash.c -- remove redundant trailing slashes from a file name |
| 2 | 2 | ||
| 3 | Copyright (C) 1990, 2001, 2003-2006, 2009-2025 Free Software Foundation, | 3 | Copyright (C) 1990, 2001, 2003-2006, 2009-2026 Free Software Foundation, |
| 4 | Inc. | 4 | Inc. |
| 5 | 5 | ||
| 6 | This file is free software: you can redistribute it and/or modify | 6 | This file is free software: you can redistribute it and/or modify |
| @@ -31,15 +31,13 @@ bool | |||
| 31 | strip_trailing_slashes (char *file) | 31 | strip_trailing_slashes (char *file) |
| 32 | { | 32 | { |
| 33 | char *base = last_component (file); | 33 | char *base = last_component (file); |
| 34 | char *base_lim; | ||
| 35 | bool had_slash; | ||
| 36 | 34 | ||
| 37 | /* last_component returns "" for file system roots, but we need to turn | 35 | /* last_component returns "" for file system roots, but we need to turn |
| 38 | "///" into "/". */ | 36 | "///" into "/". */ |
| 39 | if (! *base) | 37 | if (! *base) |
| 40 | base = file; | 38 | base = file; |
| 41 | base_lim = base + base_len (base); | 39 | char *base_lim = base + base_len (base); |
| 42 | had_slash = (*base_lim != '\0'); | 40 | bool had_slash = (*base_lim != '\0'); |
| 43 | *base_lim = '\0'; | 41 | *base_lim = '\0'; |
| 44 | return had_slash; | 42 | return had_slash; |
| 45 | } | 43 | } |
