Revision: 45975
http://brlcad.svn.sourceforge.net/brlcad/?rev=45975&view=rev
Author: bhinesley
Date: 2011-08-14 07:32:46 +0000 (Sun, 14 Aug 2011)
Log Message:
-----------
Since target object paths are not checked for fp_len>2 anymore, translate needs
to use the last two directories in path. Remove commented out code that might
have been repurposed to detect argv strings containing >2 directories. It would
be a shame to reduce functionality just to make things marginally more
intuitive.
Modified Paths:
--------------
brlcad/trunk/src/libged/edit.c
Modified: brlcad/trunk/src/libged/edit.c
===================================================================
--- brlcad/trunk/src/libged/edit.c 2011-08-14 07:18:56 UTC (rev 45974)
+++ brlcad/trunk/src/libged/edit.c 2011-08-14 07:32:46 UTC (rev 45975)
@@ -1561,7 +1561,7 @@
struct rt_comb_internal *comb;
union tree *leaf_to_modify;
- d_to_modify = DB_FULL_PATH_ROOT_DIR(path);
+ d_to_modify = DB_FULL_PATH_GET(path, path->fp_len - (size_t)2);
GED_DB_GET_INTERNAL(gedp, &intern, d_to_modify, (fastf_t *)NULL,
&rt_uniresource, GED_ERROR);
comb = (struct rt_comb_internal *)intern.idb_ptr;
@@ -1993,38 +1993,6 @@
/* detect >1 inner slashes */
first_slash = (char *)memchr((void *)path_start, '/',
(size_t)(path_end - path_start + 1));
-
-/* FIXME: This is an error for paths with > 2 directories, intended
- * for target objects only; but the check for that was mistakenly
- * never added. The point was to make it clear that supplying long
- * paths would not make a matrix translation any more specific than
- * PATH/OBJECT. However, this should be reconsidered, as accepting
- * more paths could allow for the use of more specific default
- * keypoints. Then again, using a short target object path and then
- * a long keypoint would achieved the same end. In any case, this
- * function has no way of knowing which objects are target objects,
- * so this functionality belongs either in edit() or in certain
- * subcommand functions.
- */
-#if 0
- if (first_slash && ((char *)memchr((void *)(first_slash + 1),
- '/', (size_t)(path_end -
- first_slash - 1)))) {
- /* FIXME: this conditional should be replaced by adding
- * inner slash stripping to db_string_to_path (which is
- * used below), and using a simple check for fp_len > 2
- * here
- */
- if (noisy)
- bu_vls_printf(gedp->ged_result_str, "invalid path, \"%s\"\n"
- "It is only meaningful to have one or two "
- "objects in a path in this context.\n"
- "Ex: OBJECT or PATH/OBJECT"
- "(equivalently, /OBJECT/ or /PATH/OBJECT/)",
- str);
- return GED_ERROR;
- }
-#endif
goto convert_obj;
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
FREE DOWNLOAD - uberSVN with Social Coding for Subversion.
Subversion made easy with a complete admin console. Easy
to use, easy to manage, easy to install, easy to extend.
Get a Free download of the new open ALM Subversion platform now.
http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits