From ae30dc00b43017845ab092fd3fbb2004bfb36d63 Mon Sep 17 00:00:00 2001 From: DJ Delorie Date: Wed, 21 Jul 2010 16:08:01 +0000 Subject: [PATCH] merge from gcc --- libiberty/ChangeLog | 4 ++++ libiberty/make-temp-file.c | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index 1b1610b6929..0a31b0c4c45 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,3 +1,7 @@ +2010-07-21 Pascal Obry + + * make-temp-file.c (choose_tmpdir): Append a dot to P_tmpdir if needed. + 2010-07-06 Ken Werner * floatformat.c (floatformat_ieee_half_big): New variable. diff --git a/libiberty/make-temp-file.c b/libiberty/make-temp-file.c index 13e19256534..4e3876676e2 100644 --- a/libiberty/make-temp-file.c +++ b/libiberty/make-temp-file.c @@ -121,7 +121,12 @@ choose_tmpdir (void) #endif #ifdef P_tmpdir - base = try_dir (P_tmpdir, base); + /* We really want a directory name here as if concatenated with say \dir + we do not end up with a double \\ which defines an UNC path. */ + if (strcmp (P_tmpdir, "\\") == 0) + base = try_dir ("\\.", base); + else + base = try_dir (P_tmpdir, base); #endif /* Try /var/tmp, /usr/tmp, then /tmp. */ -- 2.30.2