diff --git a/dgamelaunch.c b/dgamelaunch.c index eaf3e68..15aeff2 100644 --- a/dgamelaunch.c +++ b/dgamelaunch.c @@ -1959,13 +1959,17 @@ main (int argc, char** argv) myconfig[userchoice]->bin_args[i] = tmp; } - tmp = strdup(dgl_format_str(userchoice, me, myconfig[userchoice]->mkdir)); - free(myconfig[userchoice]->mkdir); - myconfig[userchoice]->mkdir = tmp; + if (myconfig[userchoice]->mkdir) { + tmp = strdup(dgl_format_str(userchoice, me, myconfig[userchoice]->mkdir)); + free(myconfig[userchoice]->mkdir); + myconfig[userchoice]->mkdir = tmp; + } - tmp = strdup(dgl_format_str(userchoice, me, myconfig[userchoice]->chdir)); - free(myconfig[userchoice]->chdir); - myconfig[userchoice]->chdir = tmp; + if (myconfig[userchoice]->chdir) { + tmp = strdup(dgl_format_str(userchoice, me, myconfig[userchoice]->chdir)); + free(myconfig[userchoice]->chdir); + myconfig[userchoice]->chdir = tmp; + } /* launch program */ ttyrec_main (userchoice, me->username, gen_ttyrec_filename());