Skip to content

Commit

Permalink
Fix regex output for empty patterns
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@14953 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Jan 26, 2013
1 parent 8ab86c9 commit 78af88c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions SimulationRuntime/c/util/utility.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,12 @@ extern int OpenModelica_regexImpl(const char* str, const char* re, const int max
if (!res && matches[i].rm_so != -1) {
memcpy(dup, str + matches[i].rm_so, matches[i].rm_eo - matches[i].rm_so);
dup[matches[i].rm_eo - matches[i].rm_so] = '\0';
outMatches[i] = mystrdup(dup);
nmatch++;
} else {
outMatches[i] = mystrdup("");
outMatches[nmatch++] = mystrdup(dup);
}
}
for (i=nmatch; i<maxn; i++) {
outMatches[i] = mystrdup("");
}
free(dup);
}

Expand Down

0 comments on commit 78af88c

Please sign in to comment.