* [PATCH] - fix handling of temporary directories on Windows
@ 2010-07-12 16:04 Pascal Obry
2010-07-12 17:29 ` DJ Delorie
[not found] ` <87y6dgimci.fsf@mid.deneb.enyo.de>
0 siblings, 2 replies; 4+ messages in thread
From: Pascal Obry @ 2010-07-12 16:04 UTC (permalink / raw)
To: gcc-patches
[-- Attachment #1: Type: text/plain, Size: 455 bytes --]
ChangeLog:
2010-07-09 Pascal Obry <obry@adacore.com>
* libibery/make-temp-file.c (choose_tmpdir): When TMPDIR, TMP and TEMP
are not set, P_tmpdir is used on Windows. This is defined as "\" in
current MingW header. Append a dot to ensure that when concatenating
with \dir we do not end-up with an UNC path. Fix a crash on the
compiler.
Patch as attachment.
--
Pascal Obry
--
gpg --keyserver keys.gnupg.net --recv-key F949BD3B
[-- Attachment #2: fix-temp-dir.patch --]
[-- Type: text/plain, Size: 604 bytes --]
diff libiberty/make-temp-file.c libiberty/make-temp-file.c
index 13e1925..f754b45 100644
--- libiberty/make-temp-file.c
+++ 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. */
--
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] - fix handling of temporary directories on Windows
2010-07-12 16:04 [PATCH] - fix handling of temporary directories on Windows Pascal Obry
@ 2010-07-12 17:29 ` DJ Delorie
[not found] ` <87y6dgimci.fsf@mid.deneb.enyo.de>
1 sibling, 0 replies; 4+ messages in thread
From: DJ Delorie @ 2010-07-12 17:29 UTC (permalink / raw)
To: obry; +Cc: gcc-patches
> * libibery/make-temp-file.c (choose_tmpdir): When TMPDIR, TMP and TEMP
> are not set, P_tmpdir is used on Windows. This is defined as "\" in
> current MingW header. Append a dot to ensure that when concatenating
> with \dir we do not end-up with an UNC path. Fix a crash on the
> compiler.
Ok.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] - fix handling of temporary directories on Windows
[not found] ` <87y6dgimci.fsf@mid.deneb.enyo.de>
@ 2010-07-12 19:16 ` Pascal Obry
2010-07-12 23:14 ` Dave Korn
0 siblings, 1 reply; 4+ messages in thread
From: Pascal Obry @ 2010-07-12 19:16 UTC (permalink / raw)
To: Florian Weimer; +Cc: gcc-patches
Le 12/07/2010 20:30, Florian Weimer a écrit :
> * Pascal Obry:
>
>> ChangeLog:
>>
>> 2010-07-09 Pascal Obry <obry@adacore.com>
>>
>> * libibery/make-temp-file.c (choose_tmpdir): When TMPDIR, TMP and TEMP
>
> I think it's "libiberty". 8-)
Right, good catch :) The change log should read:
2010-07-09 Pascal Obry <obry@adacore.com>
* libiberty/make-temp-file.c (choose_tmpdir): When TMPDIR, TMP and TEMP
are not set, P_tmpdir is used on Windows. This is defined as "\" in
current MingW header. Append a dot to ensure that when concatenating
with \dir we do not end-up with an UNC path. Fix a crash on the
compiler.
--
Pascal Obry
--
gpg --keyserver keys.gnupg.net --recv-key F949BD3B
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] - fix handling of temporary directories on Windows
2010-07-12 19:16 ` Pascal Obry
@ 2010-07-12 23:14 ` Dave Korn
0 siblings, 0 replies; 4+ messages in thread
From: Dave Korn @ 2010-07-12 23:14 UTC (permalink / raw)
To: obry; +Cc: Florian Weimer, gcc-patches
On 12/07/2010 20:16, Pascal Obry wrote:
> Le 12/07/2010 20:30, Florian Weimer a écrit :
>> * Pascal Obry:
>>
>>> ChangeLog:
>>>
>>> 2010-07-09 Pascal Obry <obry@adacore.com>
>>>
>>> * libibery/make-temp-file.c (choose_tmpdir): When TMPDIR, TMP and TEMP
>> I think it's "libiberty". 8-)
>
> Right, good catch :) The change log should read:
>
>
> 2010-07-09 Pascal Obry <obry@adacore.com>
>
> * libiberty/make-temp-file.c (choose_tmpdir): When TMPDIR, TMP and TEMP
Well, if we're being pedantic, it should actually say:
> * make-temp-file.c (choose_tmpdir): When TMPDIR, TMP and TEMP [ ... ]
... since this entry is going into libiberty/ChangeLog you discard the common
leading prefix.
cheers,
DaveK
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-07-12 23:14 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-12 16:04 [PATCH] - fix handling of temporary directories on Windows Pascal Obry
2010-07-12 17:29 ` DJ Delorie
[not found] ` <87y6dgimci.fsf@mid.deneb.enyo.de>
2010-07-12 19:16 ` Pascal Obry
2010-07-12 23:14 ` Dave Korn
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).