]> git.ipfire.org Git - thirdparty/rsync.git/commitdiff
Tweak NEWS & src_file().
authorWayne Davison <wayne@opencoder.net>
Sat, 25 Jul 2020 06:30:32 +0000 (23:30 -0700)
committerWayne Davison <wayne@opencoder.net>
Sat, 25 Jul 2020 06:30:32 +0000 (23:30 -0700)
NEWS.md
util2.c

diff --git a/NEWS.md b/NEWS.md
index b815cec42fb5d5261f36042f2afa61b96f8bb3f4..1f58f825ee54cd9f528a136cb476190ca4efd6b3 100644 (file)
--- a/NEWS.md
+++ b/NEWS.md
@@ -70,6 +70,8 @@
 
  - Added some compatibility code for HPE NonStop platforms.
 
+ - Improved the INSTALL.md info.
+
 ### INTERNAL:
 
  - Use a simpler overflow check idiom in a few spots.
diff --git a/util2.c b/util2.c
index 8879c987afa0888fbd008a9eb28863c558f95954..8b61d0b51c7c317d09c4e246149a7011f5e5e5eb 100644 (file)
--- a/util2.c
+++ b/util2.c
@@ -135,11 +135,8 @@ const char *src_file(const char *file)
        static int prefix = -1;
 
        if (prefix < 0) {
-               const char *cp;
-               for (cp = util2, prefix = 0; *cp; cp++) {
-                       if (*cp == '/')
-                               prefix = cp - util2 + 1;
-               }
+               const char *cp = strrchr(util2, '/');
+               prefix = cp ? cp - util2 + 1 : 0;
        }
 
        if (prefix && strncmp(file, util2, prefix) == 0)