109{
112 int before_dot = 8;
113 int after_dot = 3;
114 int chars_after_dot = 0;
115 int chars_before_dot = 0;
116 int current_length = 0;
118 int ignore = 0;
119 char *last_dot;
120 const char *pnt;
123 int ochars_after_dot;
124 int ochars_before_dot;
125 int seen_dot = 0;
126 int seen_semic = 0;
127#ifdef Eric_code_does_not_work
128 int tildes = 0;
129#endif
130
132
135
136
137
138
139
142 return (1);
143 }
144
145
146
147
151 return (1);
152 }
153
154
155
156
158
159
160
161
162
163
164
166 if ((last_dot !=
NULL) &&
167 ((last_dot[1] == '~') || (last_dot[1] == '\0'))) {
172
173
174
175 if (last_dot ==
NULL)
177 }
178
179 if (last_dot !=
NULL) {
180 ochars_after_dot =
strlen(last_dot);
181 ochars_before_dot = last_dot - pnt;
182 } else {
183 ochars_before_dot = 128;
184 ochars_after_dot = 0;
185 }
186
187
188
189
190
191
194 after_dot = before_dot - 1;
195
196 if (!dirflag) {
198
199
200
201
202
203
205 after_dot = ochars_after_dot;
206 } else {
207 before_dot -= ochars_after_dot;
208 after_dot = ochars_after_dot;
209 }
210 }
211 }
212
213 while (*pnt) {
214#ifdef VMS
215 if (
strcmp(pnt,
".DIR;1") == 0) {
216 break;
217 }
218#endif
219
220#ifdef Eric_code_does_not_work
221
222
223
224
225
226
227
228
231 pnt++;
232 continue;
233 }
234
235
236
237
240 tildes++;
241 pnt++;
242 continue;
243 }
244#endif
245
246
247
248
249
250
251
252
254
255
256
257
258 for (
c = 1,
cp = (
char *)&pnt[1];
c < 6 && *
cp;
c++,
cp++) {
259 if (*
cp <
'0' || *
cp >
'9')
260 break;
261 }
262 if (
c <= 6 && *
cp ==
'\0' &&
atoi(&pnt[1]) <= 32767)
263 seen_semic++;
264 }
265
266
267
268
269 if (ignore) {
270 pnt++;
271 continue;
272 }
274#ifdef nono
275
276
277
278 error(
_(
"Truncating '%s' to '%.*s'.\n"),
280 current_length, sresult->
isorec.name);
281 ignore++;
282#endif
283 pnt++;
284 continue;
285 }
286
287 if (seen_semic) {
288 if (seen_semic == 1) {
289 seen_semic++;
291 }
292 if (*pnt >= '0' && *pnt <= '9') {
294 }
296 pnt++;
297 continue;
298 }
299
300 if (*pnt == '.') {
302 if (
strcmp(pnt,
".tar.gz") == 0)
303 pnt = last_dot = ".tgz";
304 if (
strcmp(pnt,
".ps.gz") == 0)
305 pnt = last_dot = ".psz";
306 }
307
309
310
311
312 chars_before_dot++;
314
315 } else if (pnt == last_dot) {
316 if (seen_dot) {
317 ignore++;
318 continue;
319 }
321 seen_dot++;
323 if (chars_before_dot < before_dot) {
324 chars_before_dot++;
326 }
327 } else {
328
329
330
331
332
333 if (chars_before_dot < before_dot) {
334 chars_before_dot++;
336 }
337 }
338 } else {
339 if ((seen_dot && (chars_after_dot < after_dot) &&
340 ++chars_after_dot) ||
341 (!seen_dot && (chars_before_dot < before_dot) &&
342 ++chars_before_dot)) {
343
346
347
348
349
350
351
352
353
355 size_t flen = 1;
356 size_t tlen = 1;
357
358
359
360
361
367 }
368 } else {
370 }
374 }
376
377
378
383
384
385
386
387
388 default:
390 break;
391
392
393
394
395
396
397
398
399
400
401 case '+':
402 case '=':
403 case '%':
404
405 case ':':
406 case ';':
407 case '.':
408 case ',':
409 case '\t':
410 case ' ':
411
412 case '/':
413 case '"':
414 case '[':
415 case ']':
416
417 case '>':
418 case '<':
419 case '|':
420
421
422
423
424 case '!':
425
426 case '$':
427 case '&':
428 case '\'':
429 case '(':
430 case ')':
431 case '*':
432
433 case '?':
434 case '@':
435 case '\\':
436 case '^':
437 case '`':
438 case '{':
439 case '}':
440
441
442
443
444
445 case 1: case 2: case 3: case 4:
446 case 5: case 6: case 7: case 8:
447
448 case 10: case 11: case 12:
449 case 13: case 14: case 15:
450 case 16: case 17: case 18:
451 case 19: case 20: case 21:
452 case 22: case 23: case 24:
453 case 25: case 26: case 27:
454 case 28: case 29: case 30:
455 case 31:
456
457
458
459
460
462 break;
463
464 case '#':
465 case '-':
466 case '~':
467
468
469
470
471
474 else
476 break;
477 }
478 } else {
479 pnt++;
480 continue;
481 }
482 }
483 current_length++;
484 pnt++;
485 }
486
487
488
489
490
491
492
493
494
495#ifdef Eric_code_does_not_work
496 if (tildes == 2) {
497 int prio1 = 0;
498
500 while (*pnt && *pnt != '~') {
501 pnt++;
502 }
503 if (*pnt) {
504 pnt++;
505 }
506 while (*pnt && *pnt != '~') {
507 prio1 = 10 * prio1 + *pnt - '0';
508 pnt++;
509 }
511 }
512#endif
513
514
515
516
517 if (!dirflag) {
520 chars_before_dot--;
522 }
525 }
530 }
531 }
534
535
536#ifdef DEBBUG
538 error(
"chars_before_dot %d chars_after_dot %d seen_dot %d extra %d\n",
539 chars_before_dot, chars_after_dot, seen_dot,
extra);
540#endif
541 return (chars_before_dot + chars_after_dot + seen_dot +
extra);
542}
ACPI_SIZE strlen(const char *String)
_Check_return_ int __cdecl atoi(_In_z_ const char *_Str)
EXPORT void conv_charset(unsigned char *to, size_t *tosizep, unsigned char *from, size_t *fromsizep, siconvt_t *inls, siconvt_t *onls)
int full_iso9660_filenames