Deleted Added
full compact
entries.c (32785) entries.c (34461)
1/*
2 * Copyright (c) 1992, Brian Berliner and Jeff Polk
3 * Copyright (c) 1989-1992, Brian Berliner
4 *
5 * You may distribute under the terms of the GNU General Public License as
6 * specified in the README file that comes with the CVS source distribution.
7 *
8 * Entries file to Files file

--- 436 unchanged lines hidden (view full) ---

445 if (fprintf (fp, "\n") < 0)
446 return 1;
447 }
448
449 return 0;
450}
451
452
1/*
2 * Copyright (c) 1992, Brian Berliner and Jeff Polk
3 * Copyright (c) 1989-1992, Brian Berliner
4 *
5 * You may distribute under the terms of the GNU General Public License as
6 * specified in the README file that comes with the CVS source distribution.
7 *
8 * Entries file to Files file

--- 436 unchanged lines hidden (view full) ---

445 if (fprintf (fp, "\n") < 0)
446 return 1;
447 }
448
449 return 0;
450}
451
452
453/*
454 * Read the entries file into a list, hashing on the file name.
455 */
453/* Read the entries file into a list, hashing on the file name.
454
455 UPDATE_DIR is the name of the current directory, for use in error
456 messages, or NULL if not known (that is, noone has gotten around
457 to updating the caller to pass in the information). */
456List *
458List *
457Entries_Open (aflag)
459Entries_Open (aflag, update_dir)
458 int aflag;
460 int aflag;
461 char *update_dir;
459{
460 List *entries;
461 struct stickydirtag *sdtp = NULL;
462 Entnode *ent;
463 char *dirtag, *dirdate;
464 int dirnonbranch;
465 int do_rewrite = 0;
466 FILE *fpin;

--- 20 unchanged lines hidden (view full) ---

487 entries->list->data = (char *) sdtp;
488 entries->list->delproc = freesdt;
489 }
490
491 sawdir = 0;
492
493 fpin = CVS_FOPEN (CVSADM_ENT, "r");
494 if (fpin == NULL)
462{
463 List *entries;
464 struct stickydirtag *sdtp = NULL;
465 Entnode *ent;
466 char *dirtag, *dirdate;
467 int dirnonbranch;
468 int do_rewrite = 0;
469 FILE *fpin;

--- 20 unchanged lines hidden (view full) ---

490 entries->list->data = (char *) sdtp;
491 entries->list->delproc = freesdt;
492 }
493
494 sawdir = 0;
495
496 fpin = CVS_FOPEN (CVSADM_ENT, "r");
497 if (fpin == NULL)
498 {
499 if (update_dir != NULL)
500 error (0, 0, "in directory %s:", update_dir);
495 error (0, errno, "cannot open %s for reading", CVSADM_ENT);
501 error (0, errno, "cannot open %s for reading", CVSADM_ENT);
502 }
496 else
497 {
498 while ((ent = fgetentent (fpin, (char *) NULL, &sawdir)) != NULL)
499 {
500 (void) AddEntryNode (entries, ent);
501 }
502
503 fclose (fpin);

--- 288 unchanged lines hidden (view full) ---

792 if (sdtp != NULL && ! sdtp->subdirs)
793 {
794 FILE *fp;
795
796 sdtp->subdirs = 1;
797 if (!noexec)
798 {
799 /* Create Entries.Log so that Entries_Close will do something. */
503 else
504 {
505 while ((ent = fgetentent (fpin, (char *) NULL, &sawdir)) != NULL)
506 {
507 (void) AddEntryNode (entries, ent);
508 }
509
510 fclose (fpin);

--- 288 unchanged lines hidden (view full) ---

799 if (sdtp != NULL && ! sdtp->subdirs)
800 {
801 FILE *fp;
802
803 sdtp->subdirs = 1;
804 if (!noexec)
805 {
806 /* Create Entries.Log so that Entries_Close will do something. */
800 fp = open_file (CVSADM_ENTLOG, "a");
801 if (fclose (fp) == EOF)
802 error (1, errno, "cannot close %s", CVSADM_ENTLOG);
807 fp = CVS_FOPEN (CVSADM_ENTLOG, "a");
808 if (fp == NULL)
809 {
810 int save_errno = errno;
811
812 /* As in subdir_record, just silently skip the whole thing
813 if there is no CVSADM directory. */
814 if (! isdir (CVSADM))
815 return;
816 error (1, save_errno, "cannot open %s", entfilename);
817 }
818 else
819 {
820 if (fclose (fp) == EOF)
821 error (1, errno, "cannot close %s", CVSADM_ENTLOG);
822 }
803 }
804 }
805}
806
807/* Record subdirectory information. */
808
809static Entnode *
810subdir_record (cmd, parent, dir)

--- 351 unchanged lines hidden ---
823 }
824 }
825}
826
827/* Record subdirectory information. */
828
829static Entnode *
830subdir_record (cmd, parent, dir)

--- 351 unchanged lines hidden ---