Skip to content

Commit

Permalink
Case-insensitive keys for dimensions and roles
Browse files Browse the repository at this point in the history
  • Loading branch information
cpiker committed Dec 7, 2023
1 parent dd2492a commit 51bb8b1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion das2/dataset.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const DasDim* DasDs_getDimById(const DasDs* pThis, const char* sId)
const char* sDimId = NULL;
for(size_t u = 0; u < pThis->uDims; ++u){
sDimId = DasDim_id(pThis->lDims[u]);
if(strcmp(sId, sDimId) == 0) return pThis->lDims[u];
if(strcasecmp(sId, sDimId) == 0) return pThis->lDims[u];
}
return NULL;

Expand Down
2 changes: 1 addition & 1 deletion das2/dimension.c
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ bool DasDim_addVar(DasDim* pThis, const char* role, DasVar* pVar)
const DasVar* DasDim_getVar(const DasDim* pThis, const char* sRole)
{
for(size_t u = 0; u < pThis->uVars; ++u){
if(strcmp(pThis->aRoles[u], sRole) == 0) return pThis->aVars[u];
if(strcasecmp(pThis->aRoles[u], sRole) == 0) return pThis->aVars[u];
}
return NULL;
}
Expand Down

0 comments on commit 51bb8b1

Please sign in to comment.