[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnurl] 31/116: cli tool: improve "; type=" handling in -F
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnurl] 31/116: cli tool: improve "; type=" handling in -F option arguments |
Date: |
Tue, 05 Dec 2017 14:51:01 +0100 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnurl.
commit e240a546a7ac2fa7956adb664b8c40c4dee4f82b
Author: Patrick Monnerat <address@hidden>
AuthorDate: Sun Oct 29 14:31:03 2017 +0100
cli tool: improve ";type=" handling in -F option arguments
---
src/tool_formparse.c | 36 ++++++++++++++++--------------------
1 file changed, 16 insertions(+), 20 deletions(-)
diff --git a/src/tool_formparse.c b/src/tool_formparse.c
index c76fe6f38..719e3413f 100644
--- a/src/tool_formparse.c
+++ b/src/tool_formparse.c
@@ -233,12 +233,10 @@ static int get_param_part(struct OperationConfig *config,
char endchar,
}
/* now point beyond the content-type specifier */
- endpos = type + strlen(type_major) + strlen(type_minor) + 1;
- for(p = endpos; ISSPACE(*p); p++)
- ;
- while(*p && *p != ';' && *p != ',')
- p++;
- endct = p;
+ p = type + strlen(type_major) + strlen(type_minor) + 1;
+ for(endct = p; *p && *p != ';' && *p != endchar; p++)
+ if(!ISSPACE(*p))
+ endct = p + 1;
sep = *p;
}
else if(checkprefix("filename=", p)) {
@@ -330,29 +328,27 @@ static int get_param_part(struct OperationConfig *config,
char endchar,
sep = *p;
*endpos = '\0';
}
+ else if(endct) {
+ /* This is part of content type. */
+ for(endct = p; *p && *p != ';' && *p != endchar; p++)
+ if(!ISSPACE(*p))
+ endct = p + 1;
+ sep = *p;
+ }
else {
/* unknown prefix, skip to next block */
char *unknown = get_param_word(&p, &endpos, endchar);
sep = *p;
- if(endct)
- endct = p;
- else {
- *endpos = '\0';
- if(*unknown)
- warnf(config->global, "skip unknown form field: %s\n", unknown);
- }
+ *endpos = '\0';
+ if(*unknown)
+ warnf(config->global, "skip unknown form field: %s\n", unknown);
}
}
- /* Terminate and strip content type. */
- if(type) {
- if(!endct)
- endct = type + strlen(type);
- while(endct > type && ISSPACE(endct[-1]))
- endct--;
+ /* Terminate content type. */
+ if(endct)
*endct = '\0';
- }
if(ptype)
*ptype = type;
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnurl] 44/116: http2: Fixed OOM handling in upgrade request, (continued)
- [GNUnet-SVN] [gnurl] 44/116: http2: Fixed OOM handling in upgrade request, gnunet, 2017/12/05
- [GNUnet-SVN] [gnurl] 61/116: content_encoding: fix inflate_stream for no bytes available, gnunet, 2017/12/05
- [GNUnet-SVN] [gnurl] 51/116: url: remove arg value check from CURLOPT_SSH_AUTH_TYPES, gnunet, 2017/12/05
- [GNUnet-SVN] [gnurl] 33/116: INTERNALS: remove curlx_tv* functions no longer provided, gnunet, 2017/12/05
- [GNUnet-SVN] [gnurl] 62/116: curl_multi_fdset.3: emphasize curl_multi_timeout, gnunet, 2017/12/05
- [GNUnet-SVN] [gnurl] 39/116: cookie: avoid NULL dereference, gnunet, 2017/12/05
- [GNUnet-SVN] [gnurl] 41/116: include: remove conncache.h inclusion from where its not needed, gnunet, 2017/12/05
- [GNUnet-SVN] [gnurl] 56/116: Makefile.m32: allow to customize brotli libs, gnunet, 2017/12/05
- [GNUnet-SVN] [gnurl] 64/116: imap: deal with commands case insensitively, gnunet, 2017/12/05
- [GNUnet-SVN] [gnurl] 34/116: select: update comments, gnunet, 2017/12/05
- [GNUnet-SVN] [gnurl] 31/116: cli tool: improve "; type=" handling in -F option arguments,
gnunet <=
- [GNUnet-SVN] [gnurl] 53/116: HTTP: implement Brotli content encoding, gnunet, 2017/12/05
- [GNUnet-SVN] [gnurl] 36/116: runtests.pl: Fixed typo in message, gnunet, 2017/12/05
- [GNUnet-SVN] [gnurl] 37/116: mkhelp.pl: support reproducible build, gnunet, 2017/12/05
- [GNUnet-SVN] [gnurl] 55/116: travis: add a job with brotli enabled, gnunet, 2017/12/05
- [GNUnet-SVN] [gnurl] 63/116: connect: store IPv6 connection status after valid connection, gnunet, 2017/12/05
- [GNUnet-SVN] [gnurl] 32/116: timeval: use mach time on MacOS, gnunet, 2017/12/05
- [GNUnet-SVN] [gnurl] 47/116: curl: pass through [] in URLs instead of calling globbing error, gnunet, 2017/12/05
- [GNUnet-SVN] [gnurl] 72/116: curl_share_setopt: va_end was not called if conncache errors, gnunet, 2017/12/05
- [GNUnet-SVN] [gnurl] 14/116: transfer: Fix chunked-encoding upload bug, gnunet, 2017/12/05
- [GNUnet-SVN] [gnurl] 49/116: RELEASE-NOTES: synced with ee8016b3d, gnunet, 2017/12/05