From 46385cfa0700b047433a8d28e62c46f5b40a2a1f Mon Sep 17 00:00:00 2001 From: Rich Date: Thu, 26 Jul 2012 14:15:15 +0000 Subject: [PATCH] Fixed relative location logic to work with absolute locations --- PROMS/DataLoader/RoFst.cs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/PROMS/DataLoader/RoFst.cs b/PROMS/DataLoader/RoFst.cs index 48b588e9..38e49fa9 100644 --- a/PROMS/DataLoader/RoFst.cs +++ b/PROMS/DataLoader/RoFst.cs @@ -41,13 +41,16 @@ namespace DataLoader roDbpath = roDbpath ?? ""; if (roDbpath == "") roDbpath = @"..\ro"; - while(roDbpath.StartsWith(@"..\")) + if (roDbpath.StartsWith(@"..\")) { - di2=di2.Parent; - roDbpath = roDbpath.Substring(3); + while (roDbpath.StartsWith(@"..\")) + { + di2 = di2.Parent; + roDbpath = roDbpath.Substring(3); + } + DirectoryInfo[] dis = di2.GetDirectories(roDbpath); + if (dis.Length > 0) roDbpath = dis[0].FullName; } - DirectoryInfo [] dis = di2.GetDirectories(roDbpath); - if (dis.Length > 0) roDbpath = dis[0].FullName; //if (roDbpath == null || roDbpath == "") // roDbpath = fstPath.Substring(0, fstPath.LastIndexOf('\\')) + @"\ro";