16 lines
420 B
Diff
16 lines
420 B
Diff
--- a/libiberty/unlink-if-ordinary.c
|
|
+++ b/libiberty/unlink-if-ordinary.c
|
|
@@ -62,6 +62,12 @@ was made to unlink the file because it is special.
|
|
int
|
|
unlink_if_ordinary (const char *name)
|
|
{
|
|
+/* MS-Windows 'stat' function (and in turn, S_ISREG)
|
|
+ reports the null device as a regular file. */
|
|
+#ifdef _WIN32
|
|
+ if (stricmp (name, "nul") == 0)
|
|
+ return 1;
|
|
+#endif
|
|
struct stat st;
|
|
|
|
if (lstat (name, &st) == 0
|