comparison src/lread.c @ 6392:58e075552627

(openp, Fload): GCPRO some things.
author Karl Heuer <kwzh@gnu.org>
date Fri, 18 Mar 1994 00:13:40 +0000
parents 8af8f6b469e1
children 651b49e52c9e
comparison
equal deleted inserted replaced
6391:d4fe8a853557 6392:58e075552627
351 351
352 /* Avoid weird lossage with null string as arg, 352 /* Avoid weird lossage with null string as arg,
353 since it would try to load a directory as a Lisp file */ 353 since it would try to load a directory as a Lisp file */
354 if (XSTRING (str)->size > 0) 354 if (XSTRING (str)->size > 0)
355 { 355 {
356 GCPRO1 (str);
356 fd = openp (Vload_path, str, !NILP (nosuffix) ? "" : ".elc:.el:", 357 fd = openp (Vload_path, str, !NILP (nosuffix) ? "" : ".elc:.el:",
357 &found, 0); 358 &found, 0);
359 UNGCPRO;
358 } 360 }
359 361
360 if (fd < 0) 362 if (fd < 0)
361 { 363 {
362 if (NILP (noerror)) 364 if (NILP (noerror))
503 register char *fn = buf; 505 register char *fn = buf;
504 int absolute = 0; 506 int absolute = 0;
505 int want_size; 507 int want_size;
506 register Lisp_Object filename; 508 register Lisp_Object filename;
507 struct stat st; 509 struct stat st;
508 510 struct gcpro gcpro1;
511
512 GCPRO1 (str);
509 if (storeptr) 513 if (storeptr)
510 *storeptr = Qnil; 514 *storeptr = Qnil;
511 515
512 if (complete_filename_p (str)) 516 if (complete_filename_p (str))
513 absolute = 1; 517 absolute = 1;
561 if (fd >= 0) 565 if (fd >= 0)
562 { 566 {
563 /* We succeeded; return this descriptor and filename. */ 567 /* We succeeded; return this descriptor and filename. */
564 if (storeptr) 568 if (storeptr)
565 *storeptr = build_string (fn); 569 *storeptr = build_string (fn);
566 return fd; 570 RETURN_UNGCPRO (fd);
567 } 571 }
568 } 572 }
569 573
570 /* Advance to next suffix. */ 574 /* Advance to next suffix. */
571 if (esuffix == 0) 575 if (esuffix == 0)
572 break; 576 break;
573 nsuffix += lsuffix + 1; 577 nsuffix += lsuffix + 1;
574 } 578 }
575 if (absolute) return -1; 579 if (absolute)
576 } 580 RETURN_UNGCPRO (-1);
577 581 }
578 return -1; 582
583 RETURN_UNGCPRO (-1);
579 } 584 }
580 585
581 586
582 /* Merge the list we've accumulated of globals from the current input source 587 /* Merge the list we've accumulated of globals from the current input source
583 into the load_history variable. The details depend on whether 588 into the load_history variable. The details depend on whether