summaryrefslogtreecommitdiffstats
path: root/gl/dirname-lgpl.c
diff options
context:
space:
mode:
authorLorenz Kästle <12514511+RincewindsHat@users.noreply.github.com>2026-03-26 12:53:53 +0100
committerGitHub <noreply@github.com>2026-03-26 12:53:53 +0100
commit13e14a6bfd9f29cbfeab0c5161d2a994f97532e7 (patch)
tree3aa7186fe092e42783dc7e981dc39a74ea61c466 /gl/dirname-lgpl.c
parent9d8503f90ef25b2cecd324dc118e441f40233ea8 (diff)
downloadmonitoring-plugins-13e14a6bfd9f29cbfeab0c5161d2a994f97532e7.tar.gz
Update/gnulib 2026 03 (#2247)HEADmaster
* 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/dirname-lgpl.c')
-rw-r--r--gl/dirname-lgpl.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gl/dirname-lgpl.c b/gl/dirname-lgpl.c
index 9e0ec565..9f772e0f 100644
--- a/gl/dirname-lgpl.c
+++ b/gl/dirname-lgpl.c
@@ -1,6 +1,6 @@
1/* dirname.c -- return all but the last element in a file name 1/* dirname.c -- return all but the last element in a file name
2 2
3 Copyright (C) 1990, 1998, 2000-2001, 2003-2006, 2009-2025 Free Software 3 Copyright (C) 1990, 1998, 2000-2001, 2003-2006, 2009-2026 Free Software
4 Foundation, Inc. 4 Foundation, 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
@@ -32,7 +32,6 @@ size_t
32dir_len (char const *file) 32dir_len (char const *file)
33{ 33{
34 size_t prefix_length = FILE_SYSTEM_PREFIX_LEN (file); 34 size_t prefix_length = FILE_SYSTEM_PREFIX_LEN (file);
35 size_t length;
36 35
37 /* Advance prefix_length beyond important leading slashes. */ 36 /* Advance prefix_length beyond important leading slashes. */
38 prefix_length += (prefix_length != 0 37 prefix_length += (prefix_length != 0
@@ -45,8 +44,10 @@ dir_len (char const *file)
45 : 0)); 44 : 0));
46 45
47 /* Strip the basename and any redundant slashes before it. */ 46 /* Strip the basename and any redundant slashes before it. */
47 size_t length;
48 for (length = last_component (file) - file; 48 for (length = last_component (file) - file;
49 prefix_length < length; length--) 49 prefix_length < length;
50 length--)
50 if (! ISSLASH (file[length - 1])) 51 if (! ISSLASH (file[length - 1]))
51 break; 52 break;
52 return length; 53 return length;