char *ptr;
int i;
unsigned int i1;
-
+
/* First process options, they might be necessary for opening files
(especially include statements). */
i = 0;
sprintf(buf, "%s%c%s", incl[i], DIR_SEPARATOR, filenm);
if (gmx_fexist(buf))
{
- cpp->fn = buf;
+ cpp->fn = buf;
break;
}
sfree(buf);
gmx_fatal(FARGS, "Topology include file \"%s\" not found", filenm);
}
/* If the file name has a path component, we need to change to that
- * directory. */
- ptr = strrchr(cpp->fn, DIR_SEPARATOR);
+ * directory. Note that we - just as C - always use UNIX path separators
+ * internally in include file names.
+ */
+ ptr = strrchr(cpp->fn, '/');
if (!ptr)
{
cpp->path = NULL;
*ptr = '\0';
cpp->fn = strdup(ptr+1);
snew(cpp->cwd,STRLEN);
-
+
#if ((defined WIN32 || defined _WIN32 || defined WIN64 || defined _WIN64) && !defined __CYGWIN__ && !defined __CYGWIN32__)
pdum=_getcwd(cpp->cwd,STRLEN);
_chdir(cpp->path);
if(cwdsel!=-1)
{
fprintf(stderr,
- "Note: Force field '%s' occurs in %d places, using version from current directory.\n"
+ "Force field '%s' occurs in %d places, reading from current directory.\n"
"Use interactive selection (not the -ff option) if you prefer a different one.\n",
ffsel,nfound);
}