mirror of
https://github.com/RTimothyEdwards/netgen.git
synced 2026-08-22 14:07:07 +02:00
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:
+3
-1
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user