From: curt Date: Sat, 15 Feb 2003 18:53:44 +0000 (+0000) Subject: Oops, missed this the first time. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=44e7b36a8be5c961de488d584207833a101f270c;p=simgear.git Oops, missed this the first time. --- diff --git a/simgear/misc/sg_path.cxx b/simgear/misc/sg_path.cxx index 6398424e..d171c073 100644 --- a/simgear/misc/sg_path.cxx +++ b/simgear/misc/sg_path.cxx @@ -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) {