curl-users
[PATCH] Correctly interpret "-N" to disable buffering
From: Eric Wong <normalperson_at_yhbt.net>
Date: Sun, 7 Jun 2009 02:04:21 -0700
Date: Sun, 7 Jun 2009 02:04:21 -0700
-N means --no-buffer, but the original option name is --buffer.
So we need to negate it one more time (or one less time).
---
I came across this while working on another issue that is
highly dependent on output being unbuffered.
On a side note, would a patch to change the nobuffer code
path to use plain write(2) be accepted? It would save some
data copies to provide a small speedup.
src/main.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/main.c b/src/main.c
index 9f3970d..d00ede8 100644
--- a/src/main.c
+++ b/src/main.c
@@ -2635,7 +2635,7 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */
break;
case 'N':
/* disable the output I/O buffering */
- config->nobuffer = (bool)(!toggle);
+ config->nobuffer = (bool)(longopt ? !toggle : toggle);
break;
case 'O': /* --remote-name */
if(subletter == 'a') { /* --remote-name-all */
--
Eric Wong
-------------------------------------------------------------------
List admin: http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2009-06-07