|
@@ -131,11 +131,7 @@ parse_args(int argc, char *argv[]) {
|
|
|
streamdir->key = "stream_dir";
|
|
|
streamdir->type = TYPE_STRING;
|
|
|
streamdir->required = NO;
|
|
|
-#ifdef __MINGW32__
|
|
|
- streamdir->answer = G_convert_dirseps_from_host(G_store(getenv("TEMP")));
|
|
|
-#else
|
|
|
- streamdir->answer = G_store("/var/tmp/");
|
|
|
-#endif
|
|
|
+ //streamdir->answer = "";
|
|
|
streamdir->description=
|
|
|
_("Directory to hold temporary files (they can be large)");
|
|
|
|
|
@@ -172,7 +168,15 @@ parse_args(int argc, char *argv[]) {
|
|
|
}
|
|
|
|
|
|
opt->mem = atoi(mem->answer);
|
|
|
- opt->streamdir = streamdir->answer;
|
|
|
+ if (!streamdir->answer) {
|
|
|
+ const char *tmpdir = G_tempfile();
|
|
|
+
|
|
|
+ if (G_mkdir(tmpdir) == -1)
|
|
|
+ G_fatal_error(_("Unable to create temp dir"));
|
|
|
+ opt->streamdir = G_store(tmpdir);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ opt->streamdir = streamdir->answer;
|
|
|
|
|
|
opt->verbose = G_verbose() == G_verbose_max();
|
|
|
|