Revision: 45560
          http://brlcad.svn.sourceforge.net/brlcad/?rev=45560&view=rev
Author:   bhinesley
Date:     2011-07-21 01:53:58 +0000 (Thu, 21 Jul 2011)

Log Message:
-----------
db_string_to_path() will trim all leading slashes, but only one trailing slash; 
then it fails when more than one trailing slash is given. I can think of no 
reason why it shouldn't remove all trailing slashes, so now it does.

Modified Paths:
--------------
    brlcad/trunk/src/librt/db_fullpath.c

Modified: brlcad/trunk/src/librt/db_fullpath.c
===================================================================
--- brlcad/trunk/src/librt/db_fullpath.c        2011-07-21 00:35:49 UTC (rev 
45559)
+++ brlcad/trunk/src/librt/db_fullpath.c        2011-07-21 01:53:58 UTC (rev 
45560)
@@ -297,11 +297,13 @@
 
     copy = bu_strdup( str );
 
-    /* eliminate a a trailing slash */
+    /* eliminate all trailing slashes */
     len = strlen( copy );
-    if ( copy[len-1] == '/' )
-       copy[len-1] = '\0';
-
+    while (copy[len - 1] == '/') {
+       copy[len - 1] = '\0';
+       --len;
+    }
+       
     cp = copy;
     while ( *cp )  {
        if ( (slashp = strchr( cp, '/' )) == NULL )  break;


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

------------------------------------------------------------------------------
5 Ways to Improve & Secure Unified Communications
Unified Communications promises greater efficiencies for business. UC can 
improve internal communications as well as offer faster, more efficient ways
to interact with customers and streamline customer service. Learn more!
http://www.accelacomm.com/jaw/sfnl/114/51426253/
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to