Thread (51 messages) flat view 51 messages, 4 authors, 2016-06-15

Re: [PATCH 11/13] remote-curl: accept empty line as terminator

From: Jonathan Nieder <hidden>
Date: 2016-06-15 22:49:24

Sverre Rabbelier wrote:
  I noticed this when my tests suddenly broke. Bisecting pointed at
  the 'more rigorous return value checking' patch
Shouldn't this go before "check status code of finish_command" for
bisectability, then?
  I'm not very sure about the error message, if anyone feels it
  should go (it indicates a bug in the remote helper infrastructure,
  not a user error) it can be left out as far as I'm concerned.
No preference here.
quoted hunk ↗ jump to hunk
--- a/remote-curl.c
+++ b/remote-curl.c
@@ -813,6 +813,8 @@ int main(int argc, const char **argv)
 	do {
 		if (strbuf_getline(&buf, stdin, '\n') == EOF)
 			break;
+		if (buf.len == 0)
+			break;
This is just a bug, I think.  Other strbuf_getline() invocations in
that file all use the equivalent

	if (*buf->buf)
		break;

too.
 
quoted hunk ↗ jump to hunk
@@ -851,6 +853,7 @@ int main(int argc, const char **argv)
 			printf("\n");
 			fflush(stdout);
 		} else {
+			fprintf(stderr, "Unknown command '%s'\n", buf.buf);
 			return 1;
 		}
Reviewed-by: Jonathan Nieder <redacted>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help