]> git.mxchange.org Git - simgear.git/commitdiff
Oops, missed this the first time.
authorcurt <curt>
Sat, 15 Feb 2003 18:53:44 +0000 (18:53 +0000)
committercurt <curt>
Sat, 15 Feb 2003 18:53:44 +0000 (18:53 +0000)
simgear/misc/sg_path.cxx

index 6398424ed6f0f7de2fa808066a54bddadb8b9b7a..d171c073b70024a7f9ed3ef25f1da4e66949ffea 100644 (file)
@@ -114,6 +114,12 @@ string SGPath::dir() {
     }
 }
 
+string SGPath::filename() {
+    int index = path.rfind(SG_PATH_SEP);
+    if (index < 0) index = 0;
+    return path.substr(index);
+}
+
 bool SGPath::exists() const {
     FILE* fp = fopen( path.c_str(), "r");
     if (fp == 0) {