aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2000-11-20 08:54:32 +0000
committerDaniel Stenberg <daniel@haxx.se>2000-11-20 08:54:32 +0000
commit5d4bceda20cd1ff0d76233d2a39f58b59c75dd61 (patch)
treed63f6c69c1969c5130307db0b4f8560d9595efbe
parent42280e95bf159c4db89e3d9ea3d2e77f32cf800f (diff)
removed URL size restrictions, dynamically allocates the needed buffer
size instead
-rw-r--r--src/urlglob.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/urlglob.c b/src/urlglob.c
index d22ad40a8..246e9234f 100644
--- a/src/urlglob.c
+++ b/src/urlglob.c
@@ -49,7 +49,7 @@
#include "../lib/memdebug.h"
#endif
-char glob_buffer[URL_MAX_LENGTH];
+char *glob_buffer;
URLGlob *glob_expand;
int glob_word(char*, int);
@@ -210,10 +210,13 @@ int glob_word(char *pattern, int pos) {
int glob_url(URLGlob** glob, char* url, int *urlnum)
{
- if (strlen(url)>URL_MAX_LENGTH) {
- printf("Illegally sized URL\n");
- return CURLE_URL_MALFORMAT;
- }
+ /*
+ * We can deal with any-size, just make a buffer with the same length
+ * as the specified URL!
+ */
+ glob_buffer=(char *)malloc(strlen(url)+1);
+ if(NULL == glob_buffer)
+ return CURLE_OUT_OF_MEMORY;
glob_expand = (URLGlob*)malloc(sizeof(URLGlob));
glob_expand->size = 0;
@@ -238,6 +241,7 @@ void glob_cleanup(URLGlob* glob) {
}
}
free(glob);
+ free(glob_buffer);
}
char *next_url(URLGlob *glob)