summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Southworth <john.southworth@vyatta.com>2011-06-10 10:53:29 -0700
committerJohn Southworth <john.southworth@vyatta.com>2011-06-10 10:53:29 -0700
commitb809f0ab24eb6e71be6bcb7c365b6c3bec5cbe76 (patch)
tree553f34e108cc98a9d817d3d331927896b377c96a /src
parentcc622a5908e9421154b04b8db7a8f6d393297afc (diff)
downloadvyatta-cfg-b809f0ab24eb6e71be6bcb7c365b6c3bec5cbe76.tar.gz
vyatta-cfg-b809f0ab24eb6e71be6bcb7c365b6c3bec5cbe76.zip
Adjust the number of characters we print when creating an offset to the buffer to remove the errloc tag
Diffstat (limited to 'src')
-rw-r--r--src/cli_new.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/cli_new.c b/src/cli_new.c
index 863f6a1..2dc09e9 100644
--- a/src/cli_new.c
+++ b/src/cli_new.c
@@ -2154,7 +2154,6 @@ system_out(char *cmd, const char *prepend_msg, boolean eloc)
if (sret == 1) {
/* ready for read */
char buf[128];
- memset(buf,'\0',128);
char *out = buf;
ssize_t count = read(pfd[0], buf, 128);
if (count <= 0) {
@@ -2253,8 +2252,12 @@ system_out(char *cmd, const char *prepend_msg, boolean eloc)
/* XXX lower-layer already prepended errloc, so strip it out if
* we don't want errloc. AND in such cases we don't want the
* prepend_msg either. (!?)
+ * It looks like the lower layer will print _errloc_:[prepend_msg]
+ * see Vyatta::Config::outputError in perl.
+ * This is why when stripping errloc we don't want prepend_msg.
*/
out = (eloc ? buf : (buf + errloc_len));
+ count = (eloc ? count : (count - errloc_len));
} else {
/* XXX lower-layer did not prepend errloc */
if (eloc) {