[mw-devel] [Git][arthur/mw][master] Fix display_message when colours are off

Andrew Price welshbyte at sucs.org
Sat Sep 17 16:22:45 BST 2016


Andrew Price pushed to branch master at Justin Mitchell / mw


Commits:
03091bbd by Andrew Price at 2016-09-17T16:22:37+01:00
Fix display_message when colours are off

When display_message gets to this point, ptr might have been incremented
to its end of line value and so the loop is terminated without printing
the message. Instead, jump down to the last section of the loop where it
checks for end of line and prints the message.

(This function could really do with refactoring to avoid this goto and
make it more readable but for now this will do.)

- - - - -


1 changed file:

- src/client/main.c


Changes:

=====================================
src/client/main.c
=====================================
--- a/src/client/main.c
+++ b/src/client/main.c
@@ -1131,7 +1131,7 @@ void display_message(const char *text, int beeps, int newline)
 			/* escape sequence, skip next two chars */
 			if (s_colouroff(user))
 			{
-				continue;
+				goto eolprint;
 			}
 			hascolour++;
 
@@ -1200,7 +1200,7 @@ void display_message(const char *text, int beeps, int newline)
 			printline_in_local(line, &convert_warnings, &not_in_local);
 			i=0;
 		}
-
+eolprint:
 		if (s_nolinewrap(user))
 			endline = (ptr >= len);
 		else



View it on GitLab: https://projects.sucs.org/arthur/mw/commit/03091bbd2acaade8a004c64429528095cb815f59
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sucs.org/pipermail/mw-devel/attachments/20160917/218851fa/attachment.html>


More information about the mw-devel mailing list