View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0000557 | MetaPost | bug | public | 2011-01-10 14:58 | 2011-05-16 13:37 |
Reporter | Taco | Assigned To | Taco | ||
Priority | low | Severity | minor | Reproducibility | have not tried |
Status | closed | Resolution | fixed | ||
Fixed in Version | 1.504 | ||||
Summary | 0000557: bad basename discovery | ||||
Description | From Peb: In mplibdir/mpost.w:1201ff (main) you say: if (strstr(argv[0], "dvitomp") != NULL) { dvitomp_only=1; @<Read and set dvitomp command line options@>; } else { @<Read and set command line options@>; } I think this isn't robust for various reasons: (A) Under Windows argv[0] might end with DVITOMP.EXE (B) A symlink or copy with the (highly unrealistic) name Funny_dvitomp_Fake would be taken as dvitomp instead of mpost. Instead I'd suggest this: { const char *base = xbasename(argv[0]); if (!strcmp(base, "dvitomp") || !strcasecmp(base, "dvitomp.exe")) dvitomp_only=1; } if (dvitomp_only) { @<Read and set dvitomp command line options@>; } else { @<Read and set command line options@>; } This is still not perfect on a case insensitive Mac OS X filesystem, but that is how it is now done in analogous cases. | ||||
Tags | No tags attached. | ||||
Date Modified | Username | Field | Change |
---|---|---|---|
2011-01-10 14:58 | Taco | New Issue | |
2011-01-10 14:58 | Taco | Status | new => assigned |
2011-01-10 14:58 | Taco | Assigned To | => Taco |
2011-02-09 16:18 | Taco | Note Added: 0000737 | |
2011-02-09 16:18 | Taco | Status | assigned => resolved |
2011-02-09 16:18 | Taco | Resolution | open => fixed |
2011-05-16 13:37 | Taco | Fixed in Version | => 1.504 |
2011-05-16 13:37 | Taco | Status | resolved => closed |