|
From: <bo...@us...> - 2010-02-23 23:20:42
|
Revision: 486
http://gearbox.svn.sourceforge.net/gearbox/?rev=486&view=rev
Author: borax00
Date: 2010-02-23 23:20:33 +0000 (Tue, 23 Feb 2010)
Log Message:
-----------
Fix for bug reported by David Lobato
Modified Paths:
--------------
gearbox/trunk/src/gbxutilacfr/exceptions.cpp
Modified: gearbox/trunk/src/gbxutilacfr/exceptions.cpp
===================================================================
--- gearbox/trunk/src/gbxutilacfr/exceptions.cpp 2010-02-05 08:04:39 UTC (rev 485)
+++ gearbox/trunk/src/gbxutilacfr/exceptions.cpp 2010-02-23 23:20:33 UTC (rev 486)
@@ -28,10 +28,14 @@
Exception::basename( const char *s ) const
{
#ifndef WIN32
- return strrchr( s, '/' )+1;
+ char *slashPos = strrchr( s, '/' );
#else
- return strrchr( s, '\\' )+1;
+ char *slashPos = strrchr( s, '\\' );
#endif
+ if ( slashPos == NULL )
+ return s; // no slash found
+ else
+ return slashPos+1;
};
std::string
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|