mirror of
https://github.com/RsyncProject/rsync.git
synced 2026-05-19 04:15:56 -04:00
Tweak NEWS & src_file().
This commit is contained in:
2
NEWS.md
2
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.
|
||||
|
||||
7
util2.c
7
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)
|
||||
|
||||
Reference in New Issue
Block a user