From 4a521ba916b386048349446ba102831a2a0515c8 Mon Sep 17 00:00:00 2001 From: David Rose Date: Thu, 6 Feb 2003 23:45:13 +0000 Subject: [PATCH] fix for multiple directories on ETC_PATH --- panda/src/chancfg/chancfg.cxx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/panda/src/chancfg/chancfg.cxx b/panda/src/chancfg/chancfg.cxx index 38807d1d8a..0989d3c222 100644 --- a/panda/src/chancfg/chancfg.cxx +++ b/panda/src/chancfg/chancfg.cxx @@ -114,8 +114,17 @@ static void ReadChanConfigData(void) { ResetSetup(); ResetWindow(); - DSearchPath path = - Filename::from_os_specific(chanconfig.GetString("ETC_PATH", ".")); + // We have to convert from a space-separated list of paths, which + // might be in os-specific form, to a DSearchPath of Panda-form + // directories. We can't just use Filename::from_os_specific() on + // the whole string, since that would only work if there were just + // one directory on the path; instead, we have to convert the + // directories of the path one at a time. + DSearchPath orig_path(chanconfig.GetString("ETC_PATH", "."), " \n\t"); + DSearchPath path; + for (int i = 0; i < orig_path.get_num_directories(); i++) { + path.append_directory(Filename::from_os_specific(orig_path.get_directory(i))); + } string layoutdbfilename = chanconfig.GetString("layout-db-file","layout_db"); string windowdbfilename = chanconfig.GetString("window-db-file","window_db");