There are a number of instances throughout the code where the constant 28 is
[openssl.git] / crypto / LPdir_win.c
index 5cdcd001a71eacfaee7f09b89584f457ead08142..7eea373cde9b83690bec7067a78314b849fa4e5f 100644 (file)
@@ -36,7 +36,7 @@
 #if defined(LP_SYS_WINCE) && !defined(FindFirstFile)
 # define FindFirstFile FindFirstFileW
 #endif
-#if defined(LP_SYS_WINCE) && !defined(FindFirstFile)
+#if defined(LP_SYS_WINCE) && !defined(FindNextFile)
 # define FindNextFile FindNextFileW
 #endif
 
@@ -66,6 +66,12 @@ const char *LP_find_file(LP_DIR_CTX **ctx, const char *directory)
       char *extdirbuf = NULL;
       size_t dirlen = strlen (directory);
 
+      if (dirlen == 0)
+       {
+         errno = ENOENT;
+         return 0;
+       }
+
       *ctx = (LP_DIR_CTX *)malloc(sizeof(LP_DIR_CTX));
       if (*ctx == NULL)
        {