string greater then 255 characters).
#ifndef MAXPATHLEN
# ifdef PATH_MAX
# define MAXPATHLEN PATH_MAX
+# elif defined(MAX_PATH)
+# define MAXPATHLEN MAX_PATH
# else
# define MAXPATHLEN 256
# endif
int retval;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
- virtual_file_ex(&new_state, path, NULL, 1);
+ if (virtual_file_ex(&new_state, path, NULL, 1)) {
+ return -1;
+ }
retval = stat(new_state.cwd, buf);
#ifndef MAXPATHLEN
# ifdef PATH_MAX
# define MAXPATHLEN PATH_MAX
+# elif defined(MAX_PATH)
+# define MAXPATHLEN MAX_PATH
# else
# define MAXPATHLEN 256 /* Should be safe for any weird systems that do not define it */
# endif