Allow normal module names for -m, -x, -R, -t.

This commit is contained in:
Alex Shinn 2015-06-21 15:38:31 +09:00
parent 3fe810c86a
commit ad2b9efcdc

6
main.c
View file

@ -291,11 +291,11 @@ static sexp_uint_t multiplier (char c) {
#endif #endif
static char* make_import(const char* prefix, const char* mod, const char* suffix) { static char* make_import(const char* prefix, const char* mod, const char* suffix) {
int len = strlen(mod) + strlen(prefix) + strlen(suffix); int preflen = strlen(prefix), len = preflen + strlen(mod) + strlen(suffix);
char *p, *impmod = (char*) malloc(len+1); char *p, *impmod = (char*) malloc(len+1);
strcpy(impmod, prefix); strcpy(impmod, prefix);
strcpy(impmod+strlen(prefix), mod); strcpy(impmod+preflen, mod[0] == '(' ? mod + 1 : mod);
strcpy(impmod+len-+strlen(suffix), suffix); strcpy(impmod+len-strlen(suffix)-(mod[0] == '(' ? 1 : 0), suffix);
impmod[len] = '\0'; impmod[len] = '\0';
for (p=impmod; *p; p++) for (p=impmod; *p; p++)
if (*p == '.') *p=' '; if (*p == '.') *p=' ';