From:	CSBVAX::MRGATE!@KL.SRI.Com,@wiscvm.wisc.edu:JOE@FHCRCVAX.BITNET@SMTP 16-SEP-1987 00:06
To:	EVERHART
Subj:	FILE, bug fixes

Received: from wiscvm.wisc.edu by KL.SRI.COM with TCP; Tue 15 Sep 87 14:08:36-PDT
Received: from FHCRCVAX.BITNET by wiscvm.wisc.edu ; Tue, 15 Sep 87 16:08:53 CDT
Date: Tue, 15 Sep 87 11:39 PDT
From: Joe Meadows <JOE%FHCRCVAX.BITNET@wiscvm.wisc.edu>
Subject: FILE, bug fixes
To: info-vax@kl.sri.COM
X-VMS-To: IN%"info-vax@kl.sri.com"

Thanks to Charles Karney for pointing out a few bugs with multiple
file handling, and /OUTPUT behaviour.

  The following is output from DIFFERENCES/SLP and is suitable for
doing $ EDIT/SUM FILE.C/UPDATE=FILE.DIF assuming you call the file
FILE.DIF. The checking for /OUTPUT is moved to the beginning of the
program, rather than being inside the main loop. This fixes the problem
with multiple output files being created. A dummy call to cli$get_value
is added to reset the context of the parser. This fixes the problem with
things such as FILE FIXED.*/RECORD_SIZE=512, which crashes when there is
more than one file-spec that matches. I also added a check for the presence
of /characteristics, /attributes, and /journal qualifiers, before checking
for the presence of any of their keywords. This doesn't affect anything,
except that it saves some cpu cycles.

  If you have made modifications to FILE.C I would suggest that
you apply these fixes by hand, rather than using the EDIT/SUM command.
It should be fairly easy to figure out where they go...

  Cheers,
  Joe Meadows
!--- cut this line and above out of file and do EDIT/SUM on it ----
-   25
     15-SEP-1987
     modified handling of qualifiers, move check for /OUTPUT outside of
     loop, get values of all other qualifiers before looping through
     wildcarded filenames.
-   85,   85
  static short int output = 0;

  if (cli_present("OUTPUT") & 1) {
    /* see if they want output to go to a file or to SYS$OUTPUT */
    status = cli_get_value("OUTPUT",&retval);
    if (status & 1)
      freopen(retval,"w",stdout,"rfm=var","rat=cr");
    output = 1;
  };
-  107
      /* dummy cli_get_value, used merely to reset context */
      status = cli_get_value("OUTPUT",&retval);

-  133,  137
      if (output) {
-  150,  150

-  228,  254
      if (cli_present(t_attr) & 1) {
        Fat.fat$v_fortrancc = change(Fat.fat$v_fortrancc,t_attr,t_fortrancc);
        Fat.fat$v_impliedcc = change(Fat.fat$v_impliedcc,t_attr,t_impliedcc);
        Fat.fat$v_printcc   = change(Fat.fat$v_printcc,t_attr,t_printcc);
        Fat.fat$v_nospan    = antichange(Fat.fat$v_nospan,t_attr,t_nospan);
      };
      if (cli_present(t_char) & 1) {
        uchar.fch.fch$v_badacl = change(uchar.fch.fch$v_badacl,t_char,t_badacl);
        uchar.fch.fch$v_nobackup =
          antichange(uchar.fch.fch$v_nobackup,t_char,t_nobackup);
        uchar.fch.fch$v_contigb =
          change(uchar.fch.fch$v_contigb,t_char,t_contigb);
        uchar.fch.fch$v_nocharge =
          antichange(uchar.fch.fch$v_nocharge,t_char,t_nocharge);
        uchar.fch.fch$v_contig = change(uchar.fch.fch$v_contig,t_char,t_contig);
        uchar.fch.fch$v_directory =
          change(uchar.fch.fch$v_directory,t_char,t_directory);
        uchar.fch.fch$v_erase = change(uchar.fch.fch$v_erase,t_char,t_erase);
        uchar.fch.fch$v_badblock =
          change(uchar.fch.fch$v_badblock,t_char,t_badblock);
        uchar.fch.fch$v_locked = change(uchar.fch.fch$v_locked,t_char,t_locked);
        uchar.fch.fch$v_markdel =
          change(uchar.fch.fch$v_markdel,t_char,t_markdel);
        uchar.fch.fch$v_spool = change(uchar.fch.fch$v_spool,t_char,t_spool);
        uchar.fch.fch$v_readcheck =
          change(uchar.fch.fch$v_readcheck,t_char,t_readcheck);
        uchar.fch.fch$v_writeback =
          change(uchar.fch.fch$v_writeback,t_char,t_writeback);
        uchar.fch.fch$v_writcheck =
          change(uchar.fch.fch$v_writcheck,t_char,t_writcheck);
      };
-  306,  313
      if (cli_present(t_journal) & 1) {
        jnl.fjn$v_journal_file =
            change(jnl.fjn$v_journal_file,t_journal,t_journal_file);
        jnl.fjn$v_aijnl = change(jnl.fjn$v_aijnl,t_journal,t_aijnl);
        jnl.fjn$v_atjnl = change(jnl.fjn$v_atjnl,t_journal,t_atjnl);
        jnl.fjn$v_bijnl = change(jnl.fjn$v_bijnl,t_journal,t_bijnl);
        jnl.fjn$v_rujnl = change(jnl.fjn$v_rujnl,t_journal,t_rujnl);
        jnl.fjn$v_never_ru = change(jnl.fjn$v_never_ru,t_journal,t_never_ru);
        jnl.fjn$v_only_ru = change(jnl.fjn$v_only_ru,t_journal,t_only_ru);
      };
/
