You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by iv...@apache.org on 2019/06/07 12:12:54 UTC

svn commit: r1860748 - in /apr/apr/trunk: file_io/win32/dir.c include/arch/win32/apr_arch_file_io.h

Author: ivan
Date: Fri Jun  7 12:12:54 2019
New Revision: 1860748

URL: http://svn.apache.org/viewvc?rev=1860748&view=rev
Log:
* include/arch/win32/apr_arch_file_io.h
  (apr_dir_t): Remove union needed for ANSI support.

* file_io/win32/dir.c
  (apr_dir_open, apr_dir_read): Update code to the changes above.

Modified:
    apr/apr/trunk/file_io/win32/dir.c
    apr/apr/trunk/include/arch/win32/apr_arch_file_io.h

Modified: apr/apr/trunk/file_io/win32/dir.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/file_io/win32/dir.c?rev=1860748&r1=1860747&r2=1860748&view=diff
==============================================================================
--- apr/apr/trunk/file_io/win32/dir.c (original)
+++ apr/apr/trunk/file_io/win32/dir.c Fri Jun  7 12:12:54 2019
@@ -65,7 +65,7 @@ APR_DECLARE(apr_status_t) apr_dir_open(a
 
     /* Create a buffer for the longest file name we will ever see 
         */
-    (*new)->w.entry = apr_pcalloc(pool, sizeof(WIN32_FIND_DATAW));
+    (*new)->entry = apr_pcalloc(pool, sizeof(WIN32_FIND_DATAW));
     (*new)->name = apr_pcalloc(pool, APR_FILE_MAX * 3 + 1);
     (*new)->rootlen = len - 1;
     (*new)->pool = pool;
@@ -126,7 +126,7 @@ APR_DECLARE(apr_status_t) apr_dir_read(a
         }
 
         thedir->dirhand = FindFirstFileExW(wdirname, info_level,
-                                           thedir->w.entry,
+                                           thedir->entry,
                                            FindExSearchNameMatch, NULL,
                                            0);
         eos[0] = '\0';
@@ -143,23 +143,23 @@ APR_DECLARE(apr_status_t) apr_dir_read(a
          */
         thedir->bof = 0; 
     }
-    else if (!FindNextFileW(thedir->dirhand, thedir->w.entry)) {
+    else if (!FindNextFileW(thedir->dirhand, thedir->entry)) {
         return apr_get_os_error();
     }
 
     while (thedir->rootlen &&
-           thedir->rootlen + wcslen(thedir->w.entry->cFileName) >= APR_PATH_MAX)
+           thedir->rootlen + wcslen(thedir->entry->cFileName) >= APR_PATH_MAX)
     {
-        if (!FindNextFileW(thedir->dirhand, thedir->w.entry)) {
+        if (!FindNextFileW(thedir->dirhand, thedir->entry)) {
             return apr_get_os_error();
         }
     }
     if ((rv = unicode_to_utf8_path(thedir->name, APR_FILE_MAX * 3 + 1, 
-                                   thedir->w.entry->cFileName)))
+                                   thedir->entry->cFileName)))
         return rv;
     fname = thedir->name;
 
-    fillin_fileinfo(finfo, (WIN32_FILE_ATTRIBUTE_DATA *) thedir->w.entry,
+    fillin_fileinfo(finfo, (WIN32_FILE_ATTRIBUTE_DATA *) thedir->entry,
                     0, 1, fname, wanted);
     finfo->pool = thedir->pool;
 
@@ -184,7 +184,7 @@ APR_DECLARE(apr_status_t) apr_dir_read(a
             eos = wcschr(wdirname, '\0');
         }
 
-        wcscpy(eos, thedir->w.entry->cFileName);
+        wcscpy(eos, thedir->entry->cFileName);
         rv = more_finfo(finfo, wdirname, wanted, MORE_OF_WFSPEC);
         eos[0] = '\0';
         return rv;

Modified: apr/apr/trunk/include/arch/win32/apr_arch_file_io.h
URL: http://svn.apache.org/viewvc/apr/apr/trunk/include/arch/win32/apr_arch_file_io.h?rev=1860748&r1=1860747&r2=1860748&view=diff
==============================================================================
--- apr/apr/trunk/include/arch/win32/apr_arch_file_io.h (original)
+++ apr/apr/trunk/include/arch/win32/apr_arch_file_io.h Fri Jun  7 12:12:54 2019
@@ -199,18 +199,7 @@ struct apr_dir_t {
     apr_size_t rootlen;
     char *dirname;
     char *name;
-    union {
-#if APR_HAS_UNICODE_FS
-        struct {
-            WIN32_FIND_DATAW *entry;
-        } w;
-#endif
-#if APR_HAS_ANSI_FS
-        struct {
-            WIN32_FIND_DATAA *entry;
-        } n;
-#endif        
-    };
+    WIN32_FIND_DATAW *entry;
     int bof;
 };