[dev] [dmenu] spurious newlines

From: <wagnerdm_AT_seas.upenn.edu>
Date: Tue, 06 Dec 2011 03:35:42 -0500

In 4.4 (and 4.4.1), dmenu starting printing spurious newlines. The
problem seems to be a switch from fputs to puts; here's a patch that
reverts this change.

Apologies if the newlines were an intentional side-effect of this
change; I checked the mailing list for the two weeks around the change
but didn't see any discussion of it.

~d

diff -r bb15b563f7af dmenu.c
--- a/dmenu.c Wed Nov 23 15:17:32 2011 +0100
+++ b/dmenu.c Tue Dec 06 03:34:33 2011 -0500
_AT_@ -351,7 +351,9 @@
                  break;
          case XK_Return:
          case XK_KP_Enter:
- puts((sel && !(ev->state & ShiftMask)) ? sel->text : text);
+ /* prefer fputs, which does not change the selected text, to
+ * puts, which appends a newline */
+ fputs((sel && !(ev->state & ShiftMask)) ? sel->text : text, stdout);
                  exit(EXIT_SUCCESS);
          case XK_Right:
                  if(text[cursor] != '\0') {
Received on Tue Dec 06 2011 - 09:35:42 CET

This archive was generated by hypermail 2.3.0 : Tue Dec 06 2011 - 09:48:02 CET