mirror of
https://github.com/ksherlock/gopher.git
synced 2024-12-21 06:29:39 +00:00
url - path+query component.
This commit is contained in:
parent
9aca19b10f
commit
afe71ebe02
@ -4,8 +4,8 @@ OBJS = gopher.o url.o connection.o readline2.o scheme.o ftype.o setftype.o
|
||||
gopher: $(OBJS)
|
||||
$(CC) $(LDFLAGS) $(OBJS) $(LDLIBS) -o $@
|
||||
|
||||
utest: utest.o url.o
|
||||
$(CC) $(LDFLAGS) utest.o url.o -o $@
|
||||
utest: utest.o url.o scheme.o
|
||||
$(CC) $(LDFLAGS) utest.o url.o scheme.o -o $@
|
||||
|
||||
dtest: dtest.o dictionary.o
|
||||
$(CC) $(LDFLAGS) dtest.o dictionary.o -o $@
|
||||
|
8
url.c
8
url.c
@ -4,10 +4,9 @@
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
|
||||
|
||||
|
||||
#include "url.h"
|
||||
|
||||
|
||||
enum {
|
||||
kScheme,
|
||||
kUser,
|
||||
@ -145,7 +144,7 @@ int ParseURL(const char *url, int length, struct URLComponents *components)
|
||||
|
||||
components->scheme = range;
|
||||
|
||||
parseScheme(url, i, components);
|
||||
parse_scheme(url, i, components);
|
||||
|
||||
++i; // skip the ':'
|
||||
}
|
||||
@ -415,7 +414,6 @@ int ParseURL(const char *url, int length, struct URLComponents *components)
|
||||
components->portNumber = p;
|
||||
}
|
||||
|
||||
#if 0
|
||||
// path and query.
|
||||
// path;params?query
|
||||
range = components->path;
|
||||
@ -423,12 +421,12 @@ int ParseURL(const char *url, int length, struct URLComponents *components)
|
||||
{
|
||||
if (components->params.length)
|
||||
range.length += components->params.length + 1;
|
||||
|
||||
if (components->query.length)
|
||||
range.length += components->query.length + 1;
|
||||
|
||||
components->pathAndQuery = range;
|
||||
}
|
||||
#endif
|
||||
|
||||
return 1;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user