Revision: 51701
          http://brlcad.svn.sourceforge.net/brlcad/?rev=51701&view=rev
Author:   starseeker
Date:     2012-07-29 17:36:38 +0000 (Sun, 29 Jul 2012)
Log Message:
-----------
dirname is modifying the input string on some platforms (and the man page 
mentions this might happen) so make a separate copy of the input specifically 
to feed to the system dirname.  Fixes the dirname tests on Linux

Modified Paths:
--------------
    brlcad/trunk/src/libbu/tests/bu_dirname.c

Modified: brlcad/trunk/src/libbu/tests/bu_dirname.c
===================================================================
--- brlcad/trunk/src/libbu/tests/bu_dirname.c   2012-07-29 00:47:59 UTC (rev 
51700)
+++ brlcad/trunk/src/libbu/tests/bu_dirname.c   2012-07-29 17:36:38 UTC (rev 
51701)
@@ -37,17 +37,20 @@
 #ifdef HAVE_DIRNAME
     char *ans = NULL;
     char buf_input[1000];
+    char dirname_buf_input[1000];
     char *res = NULL;
     int pass = 0;
 
-    if (input)
+    if (input) {
        bu_strlcpy(buf_input, input, strlen(input)+1);
+       bu_strlcpy(dirname_buf_input, input, strlen(input)+1);
+    }
 
     /* build UNIX 'dirname' command */
     if (!input)
        ans = dirname(NULL);
     else
-       ans = dirname(buf_input);
+       ans = dirname(dirname_buf_input);
 
     if (!input)
        res = bu_dirname(NULL);

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


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to