|
From: <pst...@us...> - 2008-04-06 21:13:17
|
Revision: 424
http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=424&view=rev
Author: pstieber
Date: 2008-04-06 14:13:15 -0700 (Sun, 06 Apr 2008)
Log Message:
-----------
Added a custom path to FindFile so I can get the old code working on my development machine.
Modified Paths:
--------------
branches/jazz-4.1.3/src/jazz.cpp
Modified: branches/jazz-4.1.3/src/jazz.cpp
===================================================================
--- branches/jazz-4.1.3/src/jazz.cpp 2008-04-06 21:12:09 UTC (rev 423)
+++ branches/jazz-4.1.3/src/jazz.cpp 2008-04-06 21:13:15 UTC (rev 424)
@@ -654,33 +654,42 @@
const char *FindFile(const char *fname)
{
- static char buf[256];
+ static char Buffer[256];
if (wxFileExists((char *)fname))
{
return fname;
}
- char *home;
- if ((home = getenv("HOME")) != 0)
+ char* pPath;
+ if ((pPath = getenv("HOME")) != 0)
{
- sprintf(buf, "%s/%s", home, fname);
- if (wxFileExists(buf))
- return buf;
+ sprintf(Buffer, "%s/%s", pPath, fname);
+ if (wxFileExists(Buffer))
+ return Buffer;
}
- if ((home = getenv("JAZZ")) != 0)
+
+ if ((pPath = getenv("JAZZ")) != 0)
{
- sprintf(buf, "%s/%s", home, fname);
- if (wxFileExists(buf))
- return buf;
+ sprintf(Buffer, "%s/%s", pPath, fname);
+ if (wxFileExists(Buffer))
+ return Buffer;
}
// look where the executable was started
- home = wxPathOnly((char *)wxTheApp->argv[0]);
- sprintf(buf, "%s/%s", home, fname);
- if (wxFileExists(buf))
- return buf;
+ pPath = wxPathOnly((char *)wxTheApp->argv[0]);
+ sprintf(Buffer, "%s/%s", pPath, fname);
+ if (wxFileExists(Buffer))
+ {
+ return Buffer;
+ }
+ sprintf(Buffer, "/Jazz++/4.1.3/conf/%s", fname);
+ if (wxFileExists(Buffer))
+ {
+ return Buffer;
+ }
+
return 0;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|