On Tue, Apr 16, 2013 at 11:13:45AM +0200, Dominique Michel wrote:
> After updating from fvwm-2.6.5 to 2.6.6 (from cvs), the Echo command
> stopped to work. I have a few of them. As example
>
> Echo Amiga recipe loading from $.
>
> return
>
> [fvwm][]:
> Echo %s
>
> Any Echo statement always return 'Echo %s' now. And the output at
> stderr is on 2 lines when it is one 1 line with 2.6.5
Try the patch attched.
-- Thomas Adam
Index: fvwm/misc.c
===================================================================
RCS file: /home/cvs/fvwm/fvwm/fvwm/misc.c,v
retrieving revision 1.151.4.1
diff -u -p -r1.151.4.1 misc.c
--- fvwm/misc.c 22 Jan 2013 08:32:35 -0000 1.151.4.1
+++ fvwm/misc.c 16 Apr 2013 10:09:54 -0000
@@ -340,7 +340,7 @@ Bool UngrabEm(int ungrab_context)
*/
static char *fvwm_msg_strings[] =
{
- "<<DEBUG>> ", "", "", "<<WARNING>> ", "<<DEPRECATED>> ", "<<ERROR>> "
+ "<<DEBUG>> ", "Echo", "", "<<WARNING>> ", "<<DEPRECATED>> ", "<<ERROR>> "
};
void fvwm_msg(fvwm_msg_t type, char *id, char *msg, ...)
@@ -384,19 +384,19 @@ void fvwm_msg(fvwm_msg_t type, char *id,
if (type == ECHO)
{
- /* user echos must be printed as a literal string */
- fprintf(stderr, "%s\n", msg);
+ printf(stderr, "%s", msg);
+ return;
}
- else
+
+ if (type != ERR)
{
va_start(args, msg);
- asprintf(&mfmt, "%s\n", msg);
+ asprintf(&mfmt, "%s", msg);
vfprintf(stderr, mfmt, args);
va_end(args);
free(mfmt);
}
-
- if (type == ERR)
+ else
{
/* I hate to use a fixed length but this will do for now */
char tmp[2 * MAX_TOKEN_LENGTH];