Previous 15994 Revisions Next

r2916 Saturday 28th June, 2008 at 21:37:51 UTC by Nathan Woods
[Windows] Possible fix to bug #1625
[src/mess/osd/windows]winmess.c

src/mess/osd/windows/winmess.c
r2915r2916
109109   if (t_path == NULL)
110110      goto done;
111111
112   // attempt to find the first file
113   find = FindFirstFile(t_path, &find_data);
114   if (find == INVALID_HANDLE_VALUE)
115      goto done;
112   // is this path a root directory (e.g. - C:)?
113   if (isalpha(path[0]) && (path[1] == ':') && (path[2] == '\0'))
114   {
115      // need to do special logic for root directories
116      memset(&find_data, 0, sizeof(find_data));
117      find_data.dwFileAttributes = GetFileAttributes(t_path);
118   }
119   else
120   {
121      // attempt to find the first file
122      find = FindFirstFile(t_path, &find_data);
123      if (find == INVALID_HANDLE_VALUE)
124         goto done;
125   }
116126
117127   // create an osd_directory_entry; be sure to make sure that the caller can
118128   // free all resources by just freeing the resulting osd_directory_entry
r2915r2916
125135   result->size = find_data.nFileSizeLow | ((UINT64) find_data.nFileSizeHigh << 32);
126136
127137done:
128   if (t_path)
138   if (t_path != NULL)
129139      free(t_path);
130140   return result;
131141}

Previous 15994 Revisions Next


© 1998-2018 The MESS Team