Fix verboser issue over network (#2217)
authorMark Spencer <markster@digium.com>
Thu, 5 Aug 2004 21:22:56 +0000 (21:22 +0000)
committerMark Spencer <markster@digium.com>
Thu, 5 Aug 2004 21:22:56 +0000 (21:22 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3577 65c4cc65-6c06-0410-ace0-fbb531ad65f3

asterisk.c

index 62b01c1..3e39c7c 100755 (executable)
@@ -233,7 +233,18 @@ void ast_console_puts(const char *string)
 static void network_verboser(const char *s, int pos, int replace, int complete)
        /* ARGUSED */
 {
-       ast_network_puts(s);
+       if (replace) {
+               char *t = alloca(strlen(s) + 2);
+               if (t) {
+                       sprintf(t, "\r%s", s);
+                       ast_network_puts(t);
+               } else {
+                       ast_log(LOG_ERROR, "Out of memory\n");
+                       ast_network_puts(s);
+               }
+       } else {
+               ast_network_puts(s);
+       }
 }
 
 static pthread_t lthread;