Revision: 76919
http://sourceforge.net/p/brlcad/code/76919
Author: starseeker
Date: 2020-08-24 15:07:40 +0000 (Mon, 24 Aug 2020)
Log Message:
-----------
Few more get_pathname adjustments
Modified Paths:
--------------
brlcad/trunk/src/mged/cmd.c
Modified: brlcad/trunk/src/mged/cmd.c
===================================================================
--- brlcad/trunk/src/mged/cmd.c 2020-08-24 13:49:57 UTC (rev 76918)
+++ brlcad/trunk/src/mged/cmd.c 2020-08-24 15:07:40 UTC (rev 76919)
@@ -1377,8 +1377,9 @@
/* print out the display manager that we're tied to */
if (argc == 2) {
if (clp->cl_tie) {
- if (dm_get_pathname(DMP)) {
- Tcl_AppendElement(interpreter,
bu_vls_addr(dm_get_pathname(clp->cl_tie->dml_dmp)));
+ struct bu_vls *pn = dm_get_pathname(clp->cl_tie->dml_dmp);
+ if (pn && bu_vls_strlen(pn)) {
+ Tcl_AppendElement(interpreter, bu_vls_cstr(pn));
}
} else {
Tcl_AppendElement(interpreter, "");
@@ -1392,9 +1393,11 @@
else
bu_vls_strcpy(&vls, argv[2]);
- FOR_ALL_DISPLAYS(dlp, &head_dm_list.l)
- if (dm_get_pathname(dlp->dml_dmp) && !bu_vls_strcmp(&vls,
dm_get_pathname(dlp->dml_dmp)))
+ FOR_ALL_DISPLAYS(dlp, &head_dm_list.l) {
+ struct bu_vls *pn = dm_get_pathname(dlp->dml_dmp);
+ if (pn && !bu_vls_strcmp(&vls, pn))
break;
+ }
if (dlp == &head_dm_list) {
Tcl_AppendResult(interpreter, "f_tie: unrecognized path name - ",
@@ -1486,8 +1489,9 @@
/* print pathname of drawing window with primary focus */
if (argc == 1) {
- if (dm_get_pathname(DMP)) {
- Tcl_AppendResult(interpreter, bu_vls_addr(dm_get_pathname(DMP)),
(char *)NULL);
+ struct bu_vls *pn = dm_get_pathname(DMP);
+ if (pn && bu_vls_strlen(pn)) {
+ Tcl_AppendResult(interpreter, bu_vls_cstr(pn), (char *)NULL);
}
return TCL_OK;
}
@@ -1494,7 +1498,8 @@
/* change primary focus to window argv[1] */
FOR_ALL_DISPLAYS(p, &head_dm_list.l) {
- if (dm_get_pathname(p->dml_dmp) && BU_STR_EQUAL(argv[1],
bu_vls_addr(dm_get_pathname(p->dml_dmp)))) {
+ struct bu_vls *pn = dm_get_pathname(p->dml_dmp);
+ if (pn && BU_STR_EQUAL(argv[1], bu_vls_cstr(pn))) {
set_curr_dm(p);
if (curr_dm_list->dml_tie)
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits