diff options
author | Ori Bernstein <orib@google.com> | 2013-01-25 18:20:48 -0500 |
---|---|---|
committer | Ori Bernstein <orib@google.com> | 2013-01-25 18:20:48 -0500 |
commit | e2ca5299d6dbc0da053609361789274c02e3a6aa (patch) | |
tree | 899b23bd90f267b16690d954dcdd523a240e8e51 /myrbuild | |
parent | 8804ceff06b5562451c8d44c639bb88dd6990d3b (diff) | |
download | mc-e2ca5299d6dbc0da053609361789274c02e3a6aa.tar.gz |
Improve errors with malformed use file name.
Diffstat (limited to 'myrbuild')
-rw-r--r-- | myrbuild/myrbuild.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/myrbuild/myrbuild.c b/myrbuild/myrbuild.c index da69e73..c659737 100644 --- a/myrbuild/myrbuild.c +++ b/myrbuild/myrbuild.c @@ -65,11 +65,15 @@ int isquoted(char *path) return path[0] == '"' && path[strlen(path) - 1] == '"'; } -char *fromuse(char *path) +char *usetomyr(char *path) { char buf[1024]; /* skip initial quote */ path++; + if (!hassuffix(path, ".use\"")) { + fprintf(stderr, "\"%s, should end with \".use\"\n", path); + exit(1); + } swapsuffix(buf, 1024, path, ".use\"", ".myr"); return strdup(buf); } @@ -185,7 +189,7 @@ void compile(char *file) getdeps(file, deps, 512, &ndeps); for (i = 0; i < ndeps; i++) { if (isquoted(deps[i])) { - localdep = fromuse(deps[i]); + localdep = usetomyr(deps[i]); compile(localdep); free(localdep); } else { |