shithub: orca

Download patch

ref: 3c2814b50e808849a6835a9b50265525e2d9a7d4
parent: 27486da4138fbdd27873193f75e793b65d158d3b
author: Sigrid Haflínudóttir <ftrvxmtrx@gmail.com>
date: Mon Apr 13 09:49:22 EDT 2020

Revert "plan9: add "nl" command to append a newline to every UDP message (for stuff like |[3]....)"

This reverts commit 09813d3989000e11925ca1526b8e2f7545e80ae6.

--- a/plan9.c
+++ b/plan9.c
@@ -77,7 +77,6 @@
 
 static char *ip, *udpport;
 static int udp = -1;
-static int nl = 0;
 
 static char *midipath;
 static int midi = -1;
@@ -839,9 +838,7 @@
 	} else if (argc > 1) {
 		x = atoi(argv[1]);
 
-		if (s[0] == 'n' && s[1] == 'l' && s[2] == 0) /* nl */
-			nl = x;
-		else if (s[0] == 'b' && s[1] == 'p') /* bpm */
+		if (s[0] == 'b' && s[1] == 'p') /* bpm */
 			apm = bpm = MAX(1, x);
 		else if (s[0] == 'a' && s[1] == 'p') /* apm */
 			apm = MAX(1, x);
@@ -954,13 +951,7 @@
 
 		if (t == Oevent_type_udp_string && udp >= 0) {
 			Oevent_udp_string *u = &e->udp_string;
-			if (u->count < sizeof(tmp)-1) {
-				memmove(tmp, u->chars, u->count);
-				if (nl)
-					tmp[u->count++] = '\n';
-				tmp[u->count] = 0;
-				write(udp, tmp, u->count); /* FIXME show errors */
-			}
+			write(udp, u->chars, u->count); /* FIXME show errors */
 			continue;
 		} else if (t == Oevent_type_cmd_string) {
 			Oevent_cmd_string *c = &e->cmd_string;