[brlcad-commits] SF.net SVN: brlcad:[51701] brlcad/trunk/src/libbu/tests/bu_dirname.c
Open Source Solid Modeling CAD
Brought to you by:
brlcad
From: <sta...@us...> - 2012-07-29 17:36:45
|
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. |