summaryrefslogtreecommitdiffstats
path: root/gl/stripslash.c
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2026-03-27 11:14:20 +0100
committerAndreas Baumann <mail@andreasbaumann.cc>2026-03-27 11:14:20 +0100
commit1113bbcd92d85b85579aa7feef511241e58fb0f5 (patch)
treed69b7bcfe2f7e80fda9a1f4ddd38209d6cb7aaf0 /gl/stripslash.c
parent99283972fe3a74d3a1dea12c4099f76286130a67 (diff)
parenta71ce153082565e5728424749475593dc0623492 (diff)
downloadmonitoring-plugins-1113bbcd92d85b85579aa7feef511241e58fb0f5.tar.gz
merged with mastercheck_snmp_fixes
Diffstat (limited to 'gl/stripslash.c')
-rw-r--r--gl/stripslash.c8
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
31strip_trailing_slashes (char *file) 31strip_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}