vlc/vlc-2.0 | branch: master | Rui Zhang <bbcal...@gmail.com> | Sun Oct 14 02:02:11 2012 +0800| [3ca77004b99acb706a1367bdea771aa93fd5d8aa] | committer: Rémi Denis-Courmont
http: trim trailing space in field content Fix incorrect redirection given in "Location: http://host/path " Signed-off-by: Rémi Denis-Courmont <r...@remlab.net> (cherry picked from commit a05aca783e3b2a03f839d2141ee64ee835ebf1cc) > http://git.videolan.org/gitweb.cgi/vlc/vlc-2.0.git/?a=commit;h=3ca77004b99acb706a1367bdea771aa93fd5d8aa --- modules/access/http.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/modules/access/http.c b/modules/access/http.c index c8f9ef8..392a189 100644 --- a/modules/access/http.c +++ b/modules/access/http.c @@ -1374,6 +1374,7 @@ static int Request( access_t *p_access, uint64_t i_tell ) { char *psz = net_Gets( p_access, p_sys->fd, pvs ); char *p; + char *p_trailing; if( psz == NULL ) { @@ -1401,7 +1402,19 @@ static int Request( access_t *p_access, uint64_t i_tell ) goto error; } *p++ = '\0'; - while( *p == ' ' ) p++; + p += strspn( p, " \t" ); + + /* trim trailing white space */ + p_trailing = p + strlen( p ); + if( p_trailing > p ) + { + p_trailing--; + while( ( *p_trailing == ' ' || *p_trailing == '\t' ) && p_trailing > p ) + { + *p_trailing = '\0'; + p_trailing--; + } + } if( !strcasecmp( psz, "Content-Length" ) ) { _______________________________________________ vlc-commits mailing list vlc-commits@videolan.org http://mailman.videolan.org/listinfo/vlc-commits