- /* Handle absolute file name. */
- if (name[0] == DIRSEP)
- {
- if (FILE *f = fopen (name.to_str0 (), "r"))
- {
- fclose (f);
- return name;
- }
- }
-
- for (int i = 0; i < size (); i++)
- {
- String file_name = elem (i);
- String sep = ::to_string (DIRSEP);
- String right (file_name.right_string (1));
- if (file_name.length () && right != sep)
- file_name += ::to_string (DIRSEP);
-
- file_name += name;
-
-#if 0 /* Check if directory. TODO: encapsulate for autoconf */
- struct stat sbuf;
- if (stat (file_name.to_str0 (), &sbuf) != 0)
- continue;
-
- if (! (sbuf.st_mode & __S_IFREG))
- continue;
-#endif
-#if !STAT_MACROS_BROKEN
-
- struct stat sbuf;
- if (stat (file_name.to_str0 (), &sbuf) != 0)
- continue;
+#ifdef __MINGW32__
+ if (name.find ('\\') != NPOS)
+ programming_error ("file name not normalized: " + name);
+#endif /* __MINGW32__ */