mirror of
https://github.com/fadden/nulib2.git
synced 2024-06-09 10:29:26 +00:00
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
|
static Boolean
|
||||||
SpecMatchesRecord(NulibState* pState, const char* spec, const NuRecord* pRecord)
|
SpecMatchesRecord(NulibState* pState, const char* spec, const NuRecord* pRecord)
|
||||||
{
|
{
|
||||||
|
#ifdef NU_CASE_SENSITIVE
|
||||||
if (NState_GetModRecurse(pState))
|
if (NState_GetModRecurse(pState))
|
||||||
return (strncmp(spec, pRecord->filename, strlen(spec)) == 0);
|
return (strncmp(spec, pRecord->filename, strlen(spec)) == 0);
|
||||||
else
|
else
|
||||||
return (strcmp(spec, pRecord->filename) == 0);
|
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);
|
pSpec = NState_GetFilespecPointer(pState);
|
||||||
for (i = NState_GetFilespecCount(pState); i > 0; i--, pSpec++) {
|
for (i = NState_GetFilespecCount(pState); i > 0; i--, pSpec++) {
|
||||||
|
#ifdef NU_CASE_SENSITIVE
|
||||||
if (NState_GetModRecurse(pState)) {
|
if (NState_GetModRecurse(pState)) {
|
||||||
if (strncmp(*pSpec, filename, strlen(*pSpec)) == 0)
|
if (strncmp(*pSpec, filename, strlen(*pSpec)) == 0)
|
||||||
return true;
|
return true;
|
||||||
|
@ -78,6 +79,15 @@ NameIsSpecified(NulibState* pState, const char* filename)
|
||||||
if (strcmp(*pSpec, filename) == 0)
|
if (strcmp(*pSpec, filename) == 0)
|
||||||
return true;
|
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;
|
return false;
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
2003/02/18 fadden
|
2003/02/18 fadden
|
||||||
- When extracting with "-ee", disk images now have ".PO" appended.
|
- When extracting with "-ee", disk images now have ".PO" appended.
|
||||||
- Resurrected HandleAddNotFound().
|
- Resurrected HandleAddNotFound().
|
||||||
|
- Switched to case-sensitive filename comparisons.
|
||||||
|
|
||||||
2003/02/08 fadden
|
2003/02/08 fadden
|
||||||
- Upped version to v2.0.0.
|
- Upped version to v2.0.0.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user