From: Wayne Davison Date: Sat, 25 Jul 2020 06:30:32 +0000 (-0700) Subject: Tweak NEWS & src_file(). X-Git-Tag: v3.2.3pre1~21 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a5a9f268fe99316a48d5fa6fc768e89469fbe526;p=thirdparty%2Frsync.git Tweak NEWS & src_file(). --- diff --git a/NEWS.md b/NEWS.md index b815cec4..1f58f825 100644 --- 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 8879c987..8b61d0b5 100644 --- 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)