/** \file debug_types.h
- * Define the various logging classes and prioritiess
+ * Define the various logging classes and priorities
*/
/**
SG_AI = 0x00080000,
SG_ENVIRONMENT = 0x00100000,
SG_SOUND = 0x00200000,
- SG_UNDEFD = 0x00400000, // For range checkingng
+ SG_UNDEFD = 0x00400000, // For range checking
SG_ALL = 0xFFFFFFFF
} sgDebugClass;
#endif
-// If Unix, replace all ":" with "/". In windoze, allow the
-// second character to be a ":" for things like c:\foo\bar
-
+// For windows, replace "\" by "/".
void
SGPath::fix()
{
- for ( string::size_type i = 0; i < path.size(); ++i ) {
-#if defined( WIN32 )
- // for windoze, don't replace the ":" for the second character
- if ( i == 1 ) {
- continue;
- }
-#endif
- if ( path[i] == sgDirPathSepBad ) {
- path[i] = sgDirPathSep;
+ string::size_type sz = path.size();
+ for ( string::size_type i = 0; i < sz; ++i ) {
+ if ( path[i] == sgDirPathSepBad ) {
+ path[i] = sgDirPathSep;
+ }
}
+ // drop trailing "/"
+ while ((sz>1)&&(path[sz-1]==sgDirPathSep))
+ {
+ path.resize(--sz);
}
}