summary refs log tree commit diff stats
path: root/src/common/url.c
diff options
context:
space:
mode:
authorRichardHitt <rbh00@netcom.com>2013-01-14 12:33:08 -0800
committerRichardHitt <rbh00@netcom.com>2013-01-14 12:33:08 -0800
commitbe2d100d2d06c3ea31934fea30289bc1c88343ea (patch)
tree628e32e6b4bb9d9fba3751210bb28c9600c6ef79 /src/common/url.c
parent475eb9fcaab1d846a3617f587f22bd77cdeddd5e (diff)
Parse url according to rfc 1738: add separate define for TLD.
Diffstat (limited to 'src/common/url.c')
-rw-r--r--src/common/url.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/common/url.c b/src/common/url.c
index 0ee09988..1f3277cd 100644
--- a/src/common/url.c
+++ b/src/common/url.c
@@ -333,9 +333,10 @@ do_an_re(const char *word,int *start, int *end, int *type)
 }
 
 /*	Miscellaneous description --- */
-#define DOMAIN "[-a-z0-9]+(\\.[-a-z0-9]+)*\\.[a-z]+"
+#define DOMAIN "[-a-z0-9]+(\\.[-a-z0-9]+)*\\."
+#define TLD "[a-z][-a-z0-9]*[a-z]"
 #define IPADDR "[0-9]+(\\.[0-9]+){3}"
-#define HOST "(" DOMAIN "|" IPADDR ")"
+#define HOST "(" DOMAIN TLD "|" IPADDR ")"
 #define OPT_PORT "(:[1-9][0-9]{0,4})?"
 
 GRegex *