Revision: 45520
http://brlcad.svn.sourceforge.net/brlcad/?rev=45520&view=rev
Author: brlcad
Date: 2011-07-16 04:00:43 +0000 (Sat, 16 Jul 2011)
Log Message:
-----------
fix a variety of minor build issues that came up during compilation testing.
thanks starseeker!
Modified Paths:
--------------
brlcad/trunk/src/libbu/fchmod.c
Modified: brlcad/trunk/src/libbu/fchmod.c
===================================================================
--- brlcad/trunk/src/libbu/fchmod.c 2011-07-16 01:59:56 UTC (rev 45519)
+++ brlcad/trunk/src/libbu/fchmod.c 2011-07-16 04:00:43 UTC (rev 45520)
@@ -77,10 +77,10 @@
if (GetMappedFileName (GetCurrentProcess(), pMem, pszFilename,
MAXPATHLEN)) {
/* Translate path with device name to drive letters. */
- TCHAR szTemp[BUFSIZE];
+ TCHAR szTemp[MAXPATHLEN+1];
szTemp[0] = '\0';
- if (GetLogicalDriveStrings(BUFSIZE-1, szTemp)) {
+ if (GetLogicalDriveStrings(MAXPATHLEN, szTemp)) {
TCHAR szName[MAXPATHLEN];
TCHAR szDrive[3] = TEXT(" :");
int bFound = 0;
@@ -119,8 +119,12 @@
CloseHandle(hFileMap);
}
- wcstombs(filename, pszFilename, MAXPATHLEN);
- bu_strlcpy(filepath, filename, MAXPATHLEN);
+ if (sizeof(TCHAR) == sizeof(wchar_t)) {
+ wcstombs(filename, pszFilename, MAXPATHLEN);
+ bu_strlcpy(filepath, filename, MAXPATHLEN);
+ } else {
+ bu_strlcpy(filepath, pszFilename, MAXPATHLEN);
+ }
return(bSuccess);
}
#endif
@@ -147,11 +151,11 @@
* it's rather unreliable.
*/
{
- const char filepath[MAXPATHLEN+1];
+ char filepath[MAXPATHLEN+1];
int fd = fileno(fp);
HANDLE h = (HANDLE)_get_osfhandle(fd);
- GetFileNameFromHandle(h, &filepath);
- return chmod(filepath, (mode_t)pmode);
+ GetFileNameFromHandle(h, filepath);
+ return chmod(filepath, pmode);
}
#endif
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
AppSumo Presents a FREE Video for the SourceForge Community by Eric
Ries, the creator of the Lean Startup Methodology on "Lean Startup
Secrets Revealed." This video shows you how to validate your ideas,
optimize your ideas and identify your business strategy.
http://p.sf.net/sfu/appsumosfdev2dev
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits