Revision: 76660
          http://sourceforge.net/p/brlcad/code/76660
Author:   starseeker
Date:     2020-08-04 12:37:50 +0000 (Tue, 04 Aug 2020)
Log Message:
-----------
Simplify - don't need to print twice, so we can go ahead and manipulate the 
ged_result_str directly.

Modified Paths:
--------------
    brlcad/branches/bioh/src/gtools/gsh.cpp

Modified: brlcad/branches/bioh/src/gtools/gsh.cpp
===================================================================
--- brlcad/branches/bioh/src/gtools/gsh.cpp     2020-08-04 12:23:23 UTC (rev 
76659)
+++ brlcad/branches/bioh/src/gtools/gsh.cpp     2020-08-04 12:37:50 UTC (rev 
76660)
@@ -51,19 +51,12 @@
 void
 collect_io(struct ged_subprocess *p, ged_io_func_t callback, void *data)
 {
-    std::string pstr(bu_vls_cstr(p->gedp->ged_result_str));
     while (p && !p->done) {
         (*callback)(data, 0);
-       std::string nstr;
-       std::string cstr = std::string(bu_vls_cstr(p->gedp->ged_result_str));
-       if (cstr.length()) {
-           if (pstr.length()) {
-               nstr = cstr.substr(pstr.length()-1, std::string::npos);
-           } else {
-               nstr = std::string(bu_vls_cstr(p->gedp->ged_result_str));
-           }
-           printf("%s", nstr.c_str());
-           pstr = cstr;
+       long nlen = bu_vls_strlen(p->gedp->ged_result_str);
+       if (nlen) {
+           printf("%s", bu_vls_cstr(p->gedp->ged_result_str));
+           bu_vls_trunc(p->gedp->ged_result_str, 0);
        }
        std::this_thread::sleep_for(std::chrono::milliseconds(100));
     }
@@ -83,7 +76,6 @@
 void gsh_delete_io_handler(struct ged_subprocess *p, bu_process_io_t UNUSED(d))
 {
     p->done = 1;
-    bu_vls_trunc(p->gedp->ged_result_str, 0);
 }
 
 

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

Reply via email to