~ubuntu-branches/ubuntu/intrepid/curl/intrepid

« back to all changes in this revision

Viewing changes to src/urlglob.c

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2007-05-16 15:16:54 UTC
  • mfrom: (1.1.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20070516151654-jo48r81zempo1qav
Tags: 7.16.2-3ubuntu1
* Merge with Debian; remaining changes:
  - Drop the stunnel build dependency.

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 *                            | (__| |_| |  _ <| |___
6
6
 *                             \___|\___/|_| \_\_____|
7
7
 *
8
 
 * Copyright (C) 1998 - 2006, Daniel Stenberg, <daniel@haxx.se>, et al.
 
8
 * Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al.
9
9
 *
10
10
 * This software is licensed as described in the file COPYING, which
11
11
 * you should have received as part of this distribution. The terms
18
18
 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19
19
 * KIND, either express or implied.
20
20
 *
21
 
 * $Id: urlglob.c,v 1.43 2006-04-07 12:10:34 bagder Exp $
 
21
 * $Id: urlglob.c,v 1.47 2007-03-15 22:05:01 bagder Exp $
22
22
 ***************************************************************************/
23
23
 
24
24
/* client-local setup.h */
177
177
  /* patterns 0,1,2,... correspond to size=1,3,5,... */
178
178
  ++glob->size;
179
179
 
180
 
  if (isalpha((int)*pattern)) {         /* character range detected */
 
180
  if (ISALPHA(*pattern)) {         /* character range detected */
181
181
    char min_c;
182
182
    char max_c;
183
183
 
205
205
    pat->content.CharRange.ptr_c = pat->content.CharRange.min_c = min_c;
206
206
    pat->content.CharRange.max_c = max_c;
207
207
  }
208
 
  else if (isdigit((int)*pattern)) { /* numeric range detected */
 
208
  else if (ISDIGIT(*pattern)) { /* numeric range detected */
209
209
    int min_n;
210
210
    int max_n;
211
211
 
214
214
 
215
215
    rc = sscanf(pattern, "%d-%d%c%d%c", &min_n, &max_n, &sep, &step, &sep2);
216
216
 
217
 
    if ((rc < 2) || (min_n >= max_n)) {
 
217
    if ((rc < 2) || (min_n > max_n)) {
218
218
      /* the pattern is not well-formed */
219
219
      snprintf(glob->errormsg, sizeof(glob->errormsg),
220
220
               "error: bad range specification after pos %d\n", pos);
229
229
 
230
230
    if (*pattern == '0') {              /* leading zero specified */
231
231
      c = pattern;
232
 
      while (isdigit((int)*c++))
 
232
      while (ISDIGIT(*c)) {
 
233
        c++;
233
234
        ++pat->content.NumRange.padlength; /* padding length is set for all
234
235
                                              instances of this pattern */
 
236
      }
235
237
    }
236
238
 
237
239
  }
420
422
        }
421
423
        break;
422
424
      case UPTCharRange:
423
 
        pat->content.CharRange.ptr_c += pat->content.CharRange.step;
 
425
        pat->content.CharRange.ptr_c = (char)(pat->content.CharRange.step +
 
426
                           (int)((unsigned char)pat->content.CharRange.ptr_c));
424
427
        if (pat->content.CharRange.ptr_c > pat->content.CharRange.max_c) {
425
428
          pat->content.CharRange.ptr_c = pat->content.CharRange.min_c;
426
429
          carry = TRUE;
498
501
    return NULL; /* major failure */
499
502
 
500
503
  while (*filename) {
501
 
    if (*filename == '#' && isdigit((int)filename[1])) {
 
504
    if (*filename == '#' && ISDIGIT(filename[1])) {
502
505
      unsigned long i;
503
506
      char *ptr = filename;
504
507
      unsigned long num = strtoul(&filename[1], &filename, 10);