~ubuntu-branches/debian/squeeze/alpine/squeeze

« back to all changes in this revision

Viewing changes to pith/rfc2231.c

  • Committer: Bazaar Package Importer
  • Author(s): Asheesh Laroia
  • Date: 2008-03-19 12:03:02 UTC
  • mfrom: (1.2.1 upstream) (2.1.6 hardy)
  • Revision ID: james.westby@ubuntu.com-20080319120302-yam7nzcvc96y5r1n
Er, re-re-add patch to configure.ac for arm gnueabi (Closes: #471519)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#if !defined(lint) && !defined(DOS)
2
 
static char rcsid[] = "$Id: rfc2231.c 248 2006-11-20 22:54:38Z mikes@u.washington.edu $";
 
2
static char rcsid[] = "$Id: rfc2231.c 671 2007-08-15 20:28:09Z hubert@u.washington.edu $";
3
3
#endif
4
4
 
5
5
/*
6
6
 * ========================================================================
7
 
 * Copyright 2006 University of Washington
 
7
 * Copyright 2006-2007 University of Washington
8
8
 *
9
9
 * Licensed under the Apache License, Version 2.0 (the "License");
10
10
 * you may not use this file except in compliance with the License.
44
44
 
45
45
    name_len = strlen(name);
46
46
    for(; parms ; parms = parms->next)
47
 
      if(!struncmp(name, parms->attribute, name_len))
 
47
      if(!struncmp(name, parms->attribute, name_len)){
48
48
        if(parms->attribute[name_len] == '*'){
49
49
            for(p = &parms->attribute[name_len + 1], n = 0; *(p+n); n++)
50
50
              ;
75
75
                        return(NULL);           /* Too many segments! */
76
76
                    }
77
77
 
78
 
                    while(parms = parms->next)
 
78
                    while((parms = parms->next) != NULL)
79
79
                      if(!struncmp(name, parms->attribute, name_len)){
80
80
                          if(*(p = &parms->attribute[name_len]) == '*'
81
81
                              && isdigit((unsigned char) *++p))
99
99
                buf = (char *) fs_get((len + 1) * sizeof(char));
100
100
 
101
101
                for(i = len = 0; i <= count; i++){
102
 
                    if(n = *(p = pieces[i]) == '\"') /* quoted? */
 
102
                    if((n = *(p = pieces[i]) == '\"') != 0) /* quoted? */
103
103
                      p++;
104
104
 
105
105
                    while(*p && !(n && *p == '\"' && !*(p+1)))
118
118
                cs[0] = '\0';
119
119
                n = 0;
120
120
 
121
 
                if(p = strchr(buf, '\'')){
 
121
                if((p = strchr(buf, '\'')) != NULL){
122
122
                    n = (p - buf) + 1;
123
123
                    *p = '\0';
124
124
                    strncpy(cs, buf, sizeof(cs));
127
127
                    if(charset)
128
128
                      *charset = cpystr(cs);
129
129
 
130
 
                    if(p = strchr(&buf[n], '\'')){
 
130
                    if((p = strchr(&buf[n], '\'')) != NULL){
131
131
                        n = (p - buf) + 1;
132
132
                        if(lang){
133
133
                            *p = '\0';
140
140
                if(n){
141
141
                    /* Suck out the charset & lang while decoding hex */
142
142
                    p = &buf[n];
143
 
                    for(i = 0; buf[i] = *p; i++)
 
143
                    for(i = 0; (buf[i] = *p) != '\0'; i++)
144
144
                      if(*p++ == '%' && isxpair(p)){
145
145
                          buf[i] = X2C(p);
146
146
                          p += 2;
166
166
        }
167
167
        else
168
168
          return(cpystr(parms->value ? parms->value : ""));
 
169
      }
169
170
 
170
171
    return(NULL);
171
172
}