aboutsummaryrefslogtreecommitdiffstats
path: root/src/stlfile.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/stlfile.c')
-rw-r--r--src/stlfile.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/stlfile.c b/src/stlfile.c
index 953b5d7..17b97fc 100644
--- a/src/stlfile.c
+++ b/src/stlfile.c
@@ -310,7 +310,7 @@ fail:
}
int
-parse_file(struct parseinfo *info, char *buf, size_t len)
+parse_file(struct parseinfo *info, char *buf, size_t len, char **modelname)
{
int status;
const char *resp;
@@ -333,17 +333,12 @@ parse_file(struct parseinfo *info, char *buf, size_t len)
: parse_file_bin(info, buf, len);
if (status == FAIL) return FAIL;
- if (!info->modelname) {
- resp = ask("Please enter your model name: ");
- if (strlen(resp) < 4) {
- ERR("Model name is too short!\n");
- return FAIL;
- }
- info->modelname = checkp(strdup(resp));
- }
-
if (!info->solidname) info->solidname = checkp(strdup(""));
+ /* transfer ownership */
+ info->modelname = *modelname;
+ *modelname = NULL;
+
info->hash = checkp(strdup(mhash(info->modelname, -1)));
return OK;