|
From: oharboe at B. <oh...@ma...> - 2009-05-05 14:06:27
|
Author: oharboe
Date: 2009-05-05 14:06:26 +0200 (Tue, 05 May 2009)
New Revision: 1605
Modified:
trunk/src/helper/command.c
Log:
remove extra newline before prompt
Modified: trunk/src/helper/command.c
===================================================================
--- trunk/src/helper/command.c 2009-05-05 06:49:55 UTC (rev 1604)
+++ trunk/src/helper/command.c 2009-05-05 12:06:26 UTC (rev 1605)
@@ -479,19 +479,22 @@
int reslen;
result = Jim_GetString(Jim_GetResult(interp), &reslen);
- int i;
- char buff[256+1];
- for (i = 0; i < reslen; i += 256)
+ if (reslen>0)
{
- int chunk;
- chunk = reslen - i;
- if (chunk > 256)
- chunk = 256;
- strncpy(buff, result+i, chunk);
- buff[chunk] = 0;
- LOG_USER_N("%s", buff);
+ int i;
+ char buff[256+1];
+ for (i = 0; i < reslen; i += 256)
+ {
+ int chunk;
+ chunk = reslen - i;
+ if (chunk > 256)
+ chunk = 256;
+ strncpy(buff, result+i, chunk);
+ buff[chunk] = 0;
+ LOG_USER_N("%s", buff);
+ }
+ LOG_USER_N("%s", "\n");
}
- LOG_USER_N("%s", "\n");
retval=ERROR_OK;
}
return retval;
@@ -691,7 +694,7 @@
#if defined( _MSC_VER )
/* WinXX - is generic, the forward
* looking problem is this:
- *
+ *
* "win32" or "win64"
*
* "winxx" is generic.
|