[llvm-commits] [llvm] r53973 - /llvm/trunk/lib/System/Unix/Path.inc
Devang Patel
dpatel at apple.com
Wed Jul 23 17:35:38 PDT 2008
Author: dpatel
Date: Wed Jul 23 19:35:38 2008
New Revision: 53973
URL: http://llvm.org/viewvc/llvm-project?rev=53973&view=rev
Log:
Create temp. file in current path.
Modified:
llvm/trunk/lib/System/Unix/Path.inc
Modified: llvm/trunk/lib/System/Unix/Path.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/System/Unix/Path.inc?rev=53973&r1=53972&r2=53973&view=diff
==============================================================================
--- llvm/trunk/lib/System/Unix/Path.inc (original)
+++ llvm/trunk/lib/System/Unix/Path.inc Wed Jul 23 19:35:38 2008
@@ -746,14 +746,11 @@
// Append an XXXXXX pattern to the end of the file for use with mkstemp,
// mktemp or our own implementation.
char *FNBuffer = (char*) alloca(path.size()+8);
- if (isDirectory()) {
- std::string dirPath = getDirname();
- strcpy(FNBuffer, dirPath.c_str());
- strcpy(FNBuffer+dirPath.size(), "XXXXXX");
- } else {
path.copy(FNBuffer,path.size());
+ if (isDirectory())
+ strcpy(FNBuffer+path.size(), "/XXXXXX");
+ else
strcpy(FNBuffer+path.size(), "-XXXXXX");
- }
#if defined(HAVE_MKSTEMP)
int TempFD;
More information about the llvm-commits
mailing list