Skip to content

Instantly share code, notes, and snippets.

@mathieugarcia
Created June 29, 2012 16:35
Show Gist options
  • Save mathieugarcia/3019031 to your computer and use it in GitHub Desktop.
Save mathieugarcia/3019031 to your computer and use it in GitHub Desktop.
diff --git a/src/File/nglPath.cpp b/src/File/nglPath.cpp
index fdb003d..a37fcd4 100644
--- a/src/File/nglPath.cpp
+++ b/src/File/nglPath.cpp
@@ -1501,6 +1501,10 @@ int32 nglPath::GetRootPart() const
int col = mPathName.Find(_T(':'), 0, true);
int slash = mPathName.Find(_T('/'), 0, true);
+ // Not a volume
+ if (col < 0 || slash < 0)
+ return 0;
+
if (col < slash)
return MIN(slash + 1, mPathName.GetLength());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment