Revision: 44670
          http://brlcad.svn.sourceforge.net/brlcad/?rev=44670&view=rev
Author:   davidloman
Date:     2011-05-24 19:25:40 +0000 (Tue, 24 May 2011)

Log Message:
-----------
Add some string filtering loops to pull out extraneous ./ ../ and // sequences.

Modified Paths:
--------------
    geomcore/trunk/src/GS/cmds/ListCmd.cxx

Modified: geomcore/trunk/src/GS/cmds/ListCmd.cxx
===================================================================
--- geomcore/trunk/src/GS/cmds/ListCmd.cxx      2011-05-24 18:36:22 UTC (rev 
44669)
+++ geomcore/trunk/src/GS/cmds/ListCmd.cxx      2011-05-24 19:25:40 UTC (rev 
44670)
@@ -65,10 +65,27 @@
     std::list<std::string>::iterator it = args.begin();
     std::string path(*it);
 
-    this->log->logINFO("ListCmd", "Attempting to list: '" + path + "'.");
+    /* Path messaging loops. */
+    size_t loc = path.find("../");
+  while (loc != std::string::npos)
+    {
+      path.erase(loc, 3);
+      loc = path.find("../");
+    }
+  loc = path.find("./");
+  while (loc != std::string::npos)
+    {
+      path.erase(loc, 2);
+      loc = path.find("./");
+    }
+  loc = path.find("//");
+  while (loc != std::string::npos)
+    {
+      path.erase(loc, 1);
+      loc = path.find("//");
+    }
 
     DirListReqMsg req(path);
-
     p->send(&req);
 
     return true;


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery, 
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now. 
http://p.sf.net/sfu/quest-d2dcopy1
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to