Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

See if using ; under Windows work better for dirs #1124

Merged
merged 6 commits into from
Jul 8, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Try the double backslash trick in movie.c
  • Loading branch information
PaulWessel committed Jul 8, 2019
commit 8809948c356e36d60b735583e2b5b10dc8dd527a
15 changes: 14 additions & 1 deletion src/movie.c
Original file line number Diff line number Diff line change
Expand Up @@ -858,6 +858,18 @@ void close_files (struct MOVIE_CTRL *Ctrl) {
if (Ctrl->I.active) fclose (Ctrl->I.fp);
}

void double_backslahes_if_dos (char *dir) {
char tmp[PATH_MAX] = {""};
size_t k = 0, j = 0;
if (strchr (dir, '\\') == NULL) return; /* No backslashes */
while (dir[k]) {
if (dir[k] == '\\') tmp[j++] = '\\';
tmp[j++] = dir[k++];
}
tmp[j] = '\0';
strncpy (dir, tmp, j);
}

#define bailout(code) {gmt_M_free_options (mode); return (code);}
#define Return(code) {Free_Ctrl (GMT, Ctrl); gmt_end_module (GMT, GMT_cpy); bailout (code);}

Expand Down Expand Up @@ -1056,7 +1068,8 @@ int GMT_movie (void *V_API, int mode, void *args) {
sprintf (work_dir, ",%s", Ctrl->W.dir);
strcat (datadir, work_dir);
}

double_backslahes_if_dos (datadir); /* Since we will be fprintf the path we must use // for a slash */

/* Create the initialization file with settings common to all frames */

sprintf (init_file, "movie_init.%s", extension[Ctrl->In.mode]);
Expand Down