Corrected a minor issue that cropped up today in which the search
for file extensions is greedy and picks the first matching extension starting at the front of the string, such that, e.g., "file.ext.spice" is interpreted as a ".ext" file and not a ".spice" file.
This commit is contained in:
parent
7d246c36a6
commit
1c5457e180
|
|
@ -896,7 +896,9 @@ char *ReadNetlist(char *fname, int *fnum)
|
|||
|
||||
/* make first pass looking for extension */
|
||||
for (index = 0; formats[index].extension != NULL; index++) {
|
||||
if (strstr(fname, formats[index].extension) != NULL) {
|
||||
int extlen = strlen(formats[index].extension);
|
||||
int flen = strlen(fname);
|
||||
if (!strcmp(fname + flen - extlen, formats[index].extension)) {
|
||||
return (*(formats[index].proc))(fname, fnum);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue