#include "apps.h"
#if defined(OPENSSL_SYS_UNIX) || defined(__APPLE__) || \
- (defined(__VMS) && defined(__DECC) && __CTRL_VER >= 80300000)
+ (defined(__VMS) && defined(__DECC) && __CRTL_VER >= 80300000)
# include <unistd.h>
# include <stdio.h>
# include <limits.h>
OPENSSL_free(s);
}
+static int ends_with_dirsep(const char *path)
+{
+ if (*path != '\0')
+ path += strlen(path) - 1;
+# ifdef __VMS
+ if (*path == ']' || *path == '>' || *path == ':')
+ return 1;
+# elif _WIN32
+ if (*path == '\\')
+ return 1;
+# endif
+ return *path == '/';
+}
+
/*
* Process a directory; return number of errors found.
*/
return 1;
}
buflen = strlen(dirname);
- pathsep = (buflen && dirname[buflen - 1] == '/') ? "" : "/";
+ pathsep = (buflen && !ends_with_dirsep(dirname)) ? "/": "";
buflen += NAME_MAX + 1 + 1;
buf = app_malloc(buflen, "filename buffer");