ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Convert-UUlib/uulib/uuutil.c
(Generate patch)

Comparing Convert-UUlib/uulib/uuutil.c (file contents):
Revision 1.6 by root, Thu Dec 10 22:49:15 2020 UTC vs.
Revision 1.7 by root, Fri Dec 11 20:09:23 2020 UTC

52#include <uudeview.h> 52#include <uudeview.h>
53#include <uuint.h> 53#include <uuint.h>
54#include <fptools.h> 54#include <fptools.h>
55#include <uustring.h> 55#include <uustring.h>
56 56
57char * uuutil_id = "$Id: uuutil.c,v 1.6 2020/12/10 22:49:15 root Exp $"; 57char * uuutil_id = "$Id: uuutil.c,v 1.7 2020/12/11 20:09:23 root Exp $";
58 58
59/* 59/*
60 * Parts with different known extensions will not be merged by SPMS. 60 * Parts with different known extensions will not be merged by SPMS.
61 * if first character is '@', it is synonymous to the previous one. 61 * if first character is '@', it is synonymous to the previous one.
62 */ 62 */
88 88
89void 89void
90UUkillfread (fileread *data) 90UUkillfread (fileread *data)
91{ 91{
92 if (data != NULL) { 92 if (data != NULL) {
93 _FP_free (data->subject); 93 FP_free (data->subject);
94 _FP_free (data->filename); 94 FP_free (data->filename);
95 _FP_free (data->origin); 95 FP_free (data->origin);
96 _FP_free (data->mimeid); 96 FP_free (data->mimeid);
97 _FP_free (data->mimetype); 97 FP_free (data->mimetype);
98 _FP_free (data->sfname); 98 FP_free (data->sfname);
99 _FP_free (data); 99 FP_free (data);
100 } 100 }
101} 101}
102 102
103void 103void
104UUkillfile (uufile *data) 104UUkillfile (uufile *data)
105{ 105{
106 uufile *next; 106 uufile *next;
107 107
108 while (data) { 108 while (data) {
109 _FP_free (data->filename); 109 FP_free (data->filename);
110 _FP_free (data->subfname); 110 FP_free (data->subfname);
111 _FP_free (data->mimeid); 111 FP_free (data->mimeid);
112 _FP_free (data->mimetype); 112 FP_free (data->mimetype);
113 UUkillfread (data->data); 113 UUkillfread (data->data);
114 114
115 next = data->NEXT; 115 next = data->NEXT;
116 _FP_free (data); 116 FP_free (data);
117 data = next; 117 data = next;
118 } 118 }
119} 119}
120 120
121void 121void
128 if (unlink (data->binfile)) 128 if (unlink (data->binfile))
129 UUMessage (uuutil_id, __LINE__, UUMSG_WARNING, 129 UUMessage (uuutil_id, __LINE__, UUMSG_WARNING,
130 uustring (S_TMP_NOT_REMOVED), 130 uustring (S_TMP_NOT_REMOVED),
131 data->binfile, strerror (errno)); 131 data->binfile, strerror (errno));
132 132
133 _FP_free (data->filename); 133 FP_free (data->filename);
134 _FP_free (data->subfname); 134 FP_free (data->subfname);
135 _FP_free (data->mimeid); 135 FP_free (data->mimeid);
136 _FP_free (data->mimetype); 136 FP_free (data->mimetype);
137 _FP_free (data->binfile); 137 FP_free (data->binfile);
138 UUkillfile (data->thisfile); 138 UUkillfile (data->thisfile);
139 _FP_free (data->haveparts); 139 FP_free (data->haveparts);
140 _FP_free (data->misparts); 140 FP_free (data->misparts);
141 141
142 next = data->NEXT; 142 next = data->NEXT;
143 _FP_free (data); 143 FP_free (data);
144 data = next; 144 data = next;
145 } 145 }
146} 146}
147 147
148/* 148/*
151 151
152void 152void
153UUkillheaders (headers *data) 153UUkillheaders (headers *data)
154{ 154{
155 if (data != NULL) { 155 if (data != NULL) {
156 _FP_free (data->from); 156 FP_free (data->from);
157 _FP_free (data->subject); 157 FP_free (data->subject);
158 _FP_free (data->rcpt); 158 FP_free (data->rcpt);
159 _FP_free (data->date); 159 FP_free (data->date);
160 _FP_free (data->mimevers); 160 FP_free (data->mimevers);
161 _FP_free (data->ctype); 161 FP_free (data->ctype);
162 _FP_free (data->ctenc); 162 FP_free (data->ctenc);
163 _FP_free (data->fname); 163 FP_free (data->fname);
164 _FP_free (data->boundary); 164 FP_free (data->boundary);
165 _FP_free (data->mimeid); 165 FP_free (data->mimeid);
166 memset (data, 0, sizeof (headers)); 166 memset (data, 0, sizeof (headers));
167 } 167 }
168} 168}
169 169
170/* 170/*
173 */ 173 */
174 174
175static int 175static int
176UUSMPKnownExt (char *filename) 176UUSMPKnownExt (char *filename)
177{ 177{
178 char **eiter = knownexts, *ptr=_FP_strrchr(filename, '.'); 178 char **eiter = knownexts, *ptr=FP_strrchr(filename, '.');
179 int count=0, where=0; 179 int count=0, where=0;
180 180
181 if (ptr == NULL) 181 if (ptr == NULL)
182 return -1; 182 return -1;
183 ptr++; 183 ptr++;
184 184
185 while (*eiter) { 185 while (*eiter) {
186 if (_FP_stricmp (ptr, (**eiter=='@')?*eiter+1:*eiter) == 0) 186 if (FP_stricmp (ptr, (**eiter=='@')?*eiter+1:*eiter) == 0)
187 return where; 187 return where;
188 else 188 else
189 eiter++; 189 eiter++;
190 190
191 if (*eiter == NULL) 191 if (*eiter == NULL)
381 381
382 dest = iter->thisfile; 382 dest = iter->thisfile;
383 fiter = addit->thisfile; 383 fiter = addit->thisfile;
384 384
385 if (iter->filename == NULL && addit->filename != NULL) 385 if (iter->filename == NULL && addit->filename != NULL)
386 iter->filename = _FP_strdup (addit->filename); 386 iter->filename = FP_strdup (addit->filename);
387 387
388 if (addit->begin) iter->begin = 1; 388 if (addit->begin) iter->begin = 1;
389 if (addit->end) iter->end = 1; 389 if (addit->end) iter->end = 1;
390 390
391 if (addit->mode != 0 && iter->mode == 0) 391 if (addit->mode != 0 && iter->mode == 0)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines