]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
maint: basename: initialize values while declaring
authorCollin Funk <collin.funk1@gmail.com>
Sun, 7 Dec 2025 22:55:18 +0000 (14:55 -0800)
committerCollin Funk <collin.funk1@gmail.com>
Sun, 7 Dec 2025 22:56:23 +0000 (14:56 -0800)
* src/basename.c (remove_suffix): Initialize values on the same line as
their declarations.

src/basename.c

index 13eaf64dd34418ade1b500f6a8a7c06a10b99084..3455ee65ce06b5812d076cd181494c3664bc7a94 100644 (file)
@@ -83,11 +83,8 @@ Examples:\n\
 static void
 remove_suffix (char *name, char const *suffix)
 {
-  char *np;
-  char const *sp;
-
-  np = name + strlen (name);
-  sp = suffix + strlen (suffix);
+  char *np = name + strlen (name);
+  char const *sp = suffix + strlen (suffix);
 
   while (np > name && sp > suffix)
     if (*--np != *--sp)