aboutsummaryrefslogtreecommitdiff
path: root/gdbsupport/filestuff.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gdbsupport/filestuff.cc')
-rw-r--r--gdbsupport/filestuff.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/gdbsupport/filestuff.cc b/gdbsupport/filestuff.cc
index 9e07af2..5c1817e 100644
--- a/gdbsupport/filestuff.cc
+++ b/gdbsupport/filestuff.cc
@@ -1,5 +1,5 @@
/* Low-level file-handling.
- Copyright (C) 2012-2024 Free Software Foundation, Inc.
+ Copyright (C) 2012-2025 Free Software Foundation, Inc.
This file is part of GDB.
@@ -465,6 +465,13 @@ mkdir_recursive (const char *dir)
char *component_start = start;
char *component_end = start;
+#ifdef WIN32
+ /* If we're making an absolute path on windows, need to skip the drive
+ letter, which is the form 'C:/'. */
+ if (dir[0] != '\0' && dir[1] == ':' && dir[2] == '/')
+ component_start += 3;
+#endif
+
while (1)
{
/* Find the beginning of the next component. */