mirror of https://github.com/fadden/nulib2.git
Switch to case-insensitive filename comparisons. This matters most when
extracting or deleting files by name.
This commit is contained in:
parent
fa1222be3d
commit
da714d7c9b
|
@ -199,10 +199,17 @@ GetSimpleComment(NulibState* pState, const char* pathname, int maxLen)
|
|||
static Boolean
|
||||
SpecMatchesRecord(NulibState* pState, const char* spec, const NuRecord* pRecord)
|
||||
{
|
||||
#ifdef NU_CASE_SENSITIVE
|
||||
if (NState_GetModRecurse(pState))
|
||||
return (strncmp(spec, pRecord->filename, strlen(spec)) == 0);
|
||||
else
|
||||
return (strcmp(spec, pRecord->filename) == 0);
|
||||
#else
|
||||
if (NState_GetModRecurse(pState))
|
||||
return (strncasecmp(spec, pRecord->filename, strlen(spec)) == 0);
|
||||
else
|
||||
return (strcasecmp(spec, pRecord->filename) == 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -71,6 +71,7 @@ NameIsSpecified(NulibState* pState, const char* filename)
|
|||
|
||||
pSpec = NState_GetFilespecPointer(pState);
|
||||
for (i = NState_GetFilespecCount(pState); i > 0; i--, pSpec++) {
|
||||
#ifdef NU_CASE_SENSITIVE
|
||||
if (NState_GetModRecurse(pState)) {
|
||||
if (strncmp(*pSpec, filename, strlen(*pSpec)) == 0)
|
||||
return true;
|
||||
|
@ -78,6 +79,15 @@ NameIsSpecified(NulibState* pState, const char* filename)
|
|||
if (strcmp(*pSpec, filename) == 0)
|
||||
return true;
|
||||
}
|
||||
#else
|
||||
if (NState_GetModRecurse(pState)) {
|
||||
if (strncasecmp(*pSpec, filename, strlen(*pSpec)) == 0)
|
||||
return true;
|
||||
} else {
|
||||
if (strcasecmp(*pSpec, filename) == 0)
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
return false;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
2003/02/18 fadden
|
||||
- When extracting with "-ee", disk images now have ".PO" appended.
|
||||
- Resurrected HandleAddNotFound().
|
||||
- Switched to case-sensitive filename comparisons.
|
||||
|
||||
2003/02/08 fadden
|
||||
- Upped version to v2.0.0.
|
||||
|
|
Loading…
Reference in New Issue