diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2000-09-01 10:57:21 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2000-09-01 10:57:21 +0000 |
commit | a6b4c0df5f74d1238337f41d1d13f4f168ad01f1 (patch) | |
tree | ae171319a76a707e9f3aa638b7c690e40c9f5d5e /c/src/libnetworking/rtems_webserver/url.c | |
parent | 2000-08-31 Ralf Corsepius <corsepiu@faw.uni-ulm.de> (diff) | |
download | rtems-a6b4c0df5f74d1238337f41d1d13f4f168ad01f1.tar.bz2 |
2000-08-30 Joel Sherrill <joel@OARcorp.com>
* Merged version 2.1 of GoAhead webserver. This update
was submitted by Antti P Miettinen <antti.p.miettinen@nokia.com>.
* NOTES, base64.c, ejIntrn.h, emfdb.c, emfdb.h, md5.h, md5c.c,
um.c, um.h: New files.
* wbase64.c: Removed.
* Makefile.am, asp.c, balloc.c, default.c, ej.h, ejlex.c, ejparse.c,
form.c, h.c, handler.c, mime.c, misc.c, ringq.c, rom.c, security.c,
socket.c, sym.c, uemf.c, uemf.h, url.c, value.c, webcomp.c, webmain.c,
webpage.c, webrom.c, webs.c, webs.h, websuemf.c, wsIntrn.h: Modified.
Diffstat (limited to 'c/src/libnetworking/rtems_webserver/url.c')
-rw-r--r-- | c/src/libnetworking/rtems_webserver/url.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/c/src/libnetworking/rtems_webserver/url.c b/c/src/libnetworking/rtems_webserver/url.c index 75746fd490..0258387c59 100644 --- a/c/src/libnetworking/rtems_webserver/url.c +++ b/c/src/libnetworking/rtems_webserver/url.c @@ -1,7 +1,7 @@ /* * url.c -- Parse URLs * - * Copyright (c) Go Ahead Software Inc., 1995-1999. All Rights Reserved. + * Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved. * * See the file "license.txt" for usage and redistribution license requirements */ @@ -83,7 +83,7 @@ int websUrlParse(char_t *url, char_t **pbuf, char_t **phost, char_t **ppath, ulen = gstrlen(url); /* - * We allocate enough to store a separate hostname and port number fields. + * We allocate enough to store separate hostname and port number fields. * As there are 3 strings in the one buffer, we need room for 3 null chars. * We allocate MAX_PORT_LEN char_t's for the port number. */ @@ -146,16 +146,23 @@ int websUrlParse(char_t *url, char_t **pbuf, char_t **phost, char_t **ppath, } /* - * Parse the tag and the query + * Parse the query string */ - if ((cp = gstrchr(tok, '#')) != NULL) { - *cp++ = '\0'; - path = tok; - tok = cp; - } if ((cp = gstrchr(tok, '?')) != NULL) { *cp++ = '\0'; query = cp; + path = tok; + tok = query; + } + +/* + * Parse the fragment identifier + */ + if ((cp = gstrchr(tok, '#')) != NULL) { + *cp++ = '\0'; + if (*query == 0) { + path = tok; + } } /* |