diff options
Diffstat (limited to 'service/src/stlfile.c')
| -rw-r--r-- | service/src/stlfile.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/service/src/stlfile.c b/service/src/stlfile.c index 8a4ba9a..bddb24f 100644 --- a/service/src/stlfile.c +++ b/service/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; @@ -332,17 +332,11 @@ 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("")); + info->modelname = *modelname; + *modelname = NULL; + info->hash = checkp(strdup(mhash(info->modelname, -1))); return OK; |
