Tweak NEWS & src_file().

This commit is contained in:
Wayne Davison
2020-07-24 23:30:32 -07:00
parent 0a255771f4
commit a5a9f268fe
2 changed files with 4 additions and 5 deletions

View File

@@ -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.

View File

@@ -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)