]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Replace OS_SPECIFIC_DIRSEP with PATH_SEPARATOR
authorArne Schwabe <arne@rfc2549.org>
Thu, 22 Apr 2021 15:29:38 +0000 (17:29 +0200)
committerGert Doering <gert@greenie.muc.de>
Mon, 3 May 2021 06:14:53 +0000 (08:14 +0200)
We have two define that do exactly the same. Also move the check
from configure.ac to syshead.h since it is really only checking
for Windows.

Patch V2: Also remove from config-msvc.h

Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <20210422152939.2134046-5-arne@rfc2549.org>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg22203.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
config-msvc.h
configure.ac
src/openvpn/platform.c
src/openvpn/ssl_verify.c
src/openvpn/syshead.h

index 9465491ddbb1bcc465309ef61b0242d6d06edeee..360e50a058bf6616e1c0ce950ee3d455607766d8 100644 (file)
@@ -81,9 +81,6 @@
 #define HAVE_EVP_CIPHER_CTX_RESET 1
 #define HAVE_DIINSTALLDEVICE 1
 
-#define PATH_SEPARATOR     '\\'
-#define PATH_SEPARATOR_STR "\\"
-
 #ifndef __cplusplus
 #define inline __inline
 #endif
index b830abcc0d67f0c2305f0dbaea2eca6d76cfb70f..6fab623f488f4d8e964f4418d0744acaee051a69 100644 (file)
@@ -1140,14 +1140,6 @@ if test -n "${GIT}" -a -d "${srcdir}/.git"; then
 fi
 AC_MSG_RESULT([${GIT_CHECKOUT}])
 
-if test -n "${SP_PLATFORM_WINDOWS}"; then
-       AC_DEFINE_UNQUOTED([PATH_SEPARATOR], ['\\\\'], [Path separator]) #"
-       AC_DEFINE_UNQUOTED([PATH_SEPARATOR_STR], ["\\\\"], [Path separator]) #"
-else
-       AC_DEFINE_UNQUOTED([PATH_SEPARATOR], ['/'], [Path separator])
-       AC_DEFINE_UNQUOTED([PATH_SEPARATOR_STR], ["/"], [Path separator])
-fi
-
 dnl enable --x509-username-field feature if requested
 if test "${enable_x509_alt_username}" = "yes"; then
        if test "${with_crypto_library}" = "mbedtls" ; then
index c63c1d994c55893ce204ecb66b8e1031e5412856..bf7b1aa0a21ab86baf6773f2cc4d5ac134cf011c 100644 (file)
@@ -486,7 +486,7 @@ platform_gen_path(const char *directory, const char *filename,
         struct buffer out = alloc_buf_gc(outsize, gc);
         char dirsep[2];
 
-        dirsep[0] = OS_SPECIFIC_DIRSEP;
+        dirsep[0] = PATH_SEPARATOR;
         dirsep[1] = '\0';
 
         if (directory)
index 25bd176d6675c5581beac12b4e99b6152b741389..98ec0e4eafeb0655c8779a21b85616456b28e543 100644 (file)
@@ -616,7 +616,7 @@ verify_check_crl_dir(const char *crl_dir, openvpn_x509_cert_t *cert,
         goto cleanup;
     }
 
-    if (!openvpn_snprintf(fn, sizeof(fn), "%s%c%s", crl_dir, OS_SPECIFIC_DIRSEP, serial))
+    if (!openvpn_snprintf(fn, sizeof(fn), "%s%c%s", crl_dir, PATH_SEPARATOR, serial))
     {
         msg(D_HANDSHAKE, "VERIFY CRL: filename overflow");
         goto cleanup;
index 42465d01d4fc7fadf9554dc18288a326078495a1..05aaa51835917680c19b04e96c8ff922ccba908f 100644 (file)
@@ -436,9 +436,11 @@ typedef unsigned short sa_family_t;
  * Directory separation char
  */
 #ifdef _WIN32
-#define OS_SPECIFIC_DIRSEP '\\'
+#define PATH_SEPARATOR '\\'
+#define PATH_SEPARATOR_STR "\\"
 #else
-#define OS_SPECIFIC_DIRSEP '/'
+#define PATH_SEPARATOR '/'
+#define PATH_SEPARATOR_STR "/"
 #endif
 
 /*