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
Next Next commit
See if using ; under Windows work better for dirs
In movie, we select the directory separator based on the scripting language, but since this fails on Windows perhaps we should always select ; there.  Give it a try on the animation tests.
  • Loading branch information
PaulWessel committed Jul 7, 2019
commit ba0950a65e7248fc2c9eb6dcd7f7535974f58c78
16 changes: 11 additions & 5 deletions src/movie.c
Original file line number Diff line number Diff line change
Expand Up @@ -867,7 +867,7 @@ int GMT_movie (void *V_API, int mode, void *args) {

unsigned int n_values = 0, n_frames = 0, frame, i_frame, col, p_width, p_height, k, T;
unsigned int n_frames_not_started = 0, n_frames_completed = 0, first_frame = 0, n_cores_unused;
unsigned int dd, hh, mm, ss, flavor = 0;
unsigned int dd, hh, mm, ss, flavor = 0, path_id = 0;

bool done = false, layers = false, one_frame = false, has_text = false, is_classic = false, upper_case = false;

Expand Down Expand Up @@ -1038,10 +1038,16 @@ int GMT_movie (void *V_API, int mode, void *args) {
}

/* We use DATADIR to include the top and working directory so any files we supply or create can be found while inside frame directory */
#ifdef WIN32
path_id = DOS_MODE;
#else
path_id = Ctrl->In.mode;
#endif

if (GMT->session.DATADIR) /* Prepend initial and subdir as new datadirs to the existing search list */
sprintf (datadir, "%s%c%s%c%s", topdir, path_sep[Ctrl->In.mode], cwd, path_sep[Ctrl->In.mode], GMT->session.DATADIR);
sprintf (datadir, "%s%c%s%c%s", topdir, path_sep[path_id], cwd, path_sep[path_id, GMT->session.DATADIR);
else /* Set the initial and prefix subdirectory as data dirs */
sprintf (datadir, "%s%c%s", topdir, path_sep[Ctrl->In.mode], cwd);
sprintf (datadir, "%s%c%s", topdir, path_sep[path_id], cwd);
if (Ctrl->W.active && strlen (Ctrl->W.dir) > 2) { /* Also append a specific work directory with data files that we should search */
char work_dir[PATH_MAX] = {""};
#ifdef WIN32
Expand All @@ -1050,9 +1056,9 @@ int GMT_movie (void *V_API, int mode, void *args) {
if (Ctrl->W.dir[0] != '/') /* Not hard path */
#endif
/* Prepend cwd to the given relative path and update Ctrl->D.dir */
sprintf (work_dir, "%c%s%c%s", path_sep[Ctrl->In.mode], topdir, dir_sep, Ctrl->W.dir);
sprintf (work_dir, "%c%s%c%s", path_sep[path_id], topdir, dir_sep, Ctrl->W.dir);
else
sprintf (work_dir, "%c%s", path_sep[Ctrl->In.mode], Ctrl->W.dir);
sprintf (work_dir, "%c%s", path_sep[path_id], Ctrl->W.dir);
strcat (datadir, work_dir);
}

Expand Down