From 44e7b36a8be5c961de488d584207833a101f270c Mon Sep 17 00:00:00 2001 From: curt Date: Sat, 15 Feb 2003 18:53:44 +0000 Subject: [PATCH] Oops, missed this the first time. --- simgear/misc/sg_path.cxx | 6 ++++++ 1 file changed, 6 insertions(+) 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) { -- 2.39.5