warning to users of INDENT.EXE

Lars Henrik Mathiesen thorinn at rimfaxe.diku.dk
Sun Nov 25 01:42:49 AEST 1990


mcdonald at aries.scs.uiuc.edu (Doug McDonald) writes:
>In article <73542 at iuvax.cs.indiana.edu> bomgard at iuvax.cs.indiana.edu (Tim Bomgardner) writes:
>>A couple days later I discovered indent had made some
>>unauthorized changes.

>Yes indeed. However, you have a very old version. The version to
>circulate recently in the source groups has this thoroughly fixed.

>Doug McDonald

If you have sources for a 4.3-derived indent, and you don't feel like
searching the source groups for a new and possibly much incompatible
(``improved'') version, here are the fixes we made about three
incarnations of this discussion ago. Even fixes the manual!

--
Lars Mathiesen, DIKU, U of Copenhagen, Denmark      [uunet!]mcsun!diku!thorinn
Institute of Datalogy -- we're scientists, not engineers.      thorinn at diku.dk

RCS file: RCS/args.c,v
retrieving revision 1.1
diff -c -r1.1 args.c
*** /tmp/,RCSt1003415   Sat Nov 24 15:22:16 1990
--- args.c      Wed Jan 17 14:57:27 1990
***************
*** 97,102 ****
--- 97,104 ----
      "nbbb",   PRO_BOOL,       false,  OFF, &blanklines_before_blockcomments,
      "ps",     PRO_BOOL,       false,  ON,     &pointer_as_binop,
      "nps",    PRO_BOOL,       false,  OFF,    &pointer_as_binop,
+     "osa",    PRO_BOOL,       false,  ON,     &convert_old_assignment,
+     "nosa",   PRO_BOOL,       false,  OFF,    &convert_old_assignment,
      "troff",  PRO_BOOL,       false,  ON,     &troff,
      "T",      PRO_SPECIAL,    0,      KEY,    0,
   /* whew! */
RCS file: RCS/indent.1,v
retrieving revision 1.1
diff -c -r1.1 indent.1
*** /tmp/,RCSt1003420   Sat Nov 24 15:22:17 1990
--- indent.1    Wed Jan 17 14:57:30 1990
***************
*** 33,38 ****
--- 33,39 ----
  [\ \fB\-l\fIn\fR\ ]
  [\ \fB\-lc\fIn\fR\ ]
  [\ \fB\-lp\fR\ |\ \fB\-nlp\fR\ ]
+ [\ \fB\-osa\fR\ |\ \fB\-nosa\fR\ ]
  [\ \fB\-npro\fR\ ]
  [\ \fB\-pcs\fR\ |\ \fB\-npcs\fR\ ]
  [\ \fB\-ps\fR\ |\ \fB\-nps\fR\ ]
***************
*** 265,270 ****
--- 266,277 ----
                p5));
  .ft R
  .fi
+ .TP 15
+ .BR \-osa , \-nosa
+ If true (\fB\-osa\fR) old style assignment operators (`=-', `=*', and so on)
+ are considered to be tokens, and are converted to the newer form (`-=', `*=').
+ The default is
+ .BR \-nosa .
  .TP 15
  .B \-npro
  Causes the profile files, `./.indent.pro' and `~/.indent.pro', to be ignored.
RCS file: RCS/indent_globs.h,v
retrieving revision 1.1
diff -c -r1.1 indent_globs.h
*** /tmp/,RCSt1003425   Sat Nov 24 15:22:19 1990
--- indent_globs.h      Wed Jan 17 14:57:33 1990
***************
*** 121,126 ****
--- 121,128 ----
  int   lineup_to_parens;       /* if true, continued code within parens will
                                   be lined up to the open paren */
  int   block_comment_max_col;
+ int   convert_old_assignment; /* if true, old style assignment operators (=+)
+                                  are accepted and converted to new style */


  struct parser_state {
RCS file: RCS/lexi.c,v
retrieving revision 1.1
diff -c -r1.1 lexi.c
*** /tmp/,RCSt1003430   Sat Nov 24 15:22:20 1990
--- lexi.c      Wed Jan 17 14:57:36 1990
***************
*** 461,468 ****
        case '=':
            if (ps.in_or_st)
                ps.block_init = 1;
!           if (chartype[*buf_ptr] == opchar) { /* we have two char
                                                 * assignment */
                tok[-1] = *buf_ptr++;
                if ((tok[-1] == '<' || tok[-1] == '>') && tok[-1] == *buf_ptr)
                    *tok++ = *buf_ptr++;
--- 461,470 ----
        case '=':
            if (ps.in_or_st)
                ps.block_init = 1;
!           if (convert_old_assignment &&
!               chartype[*buf_ptr & 0177] == opchar) {  /* we have two char
                                                 * assignment */
+               printf("%d: Old style assignment converted\n", line_no);
                tok[-1] = *buf_ptr++;
                if ((tok[-1] == '<' || tok[-1] == '>') && tok[-1] == *buf_ptr)
                    *tok++ = *buf_ptr++;



More information about the Comp.lang.c mailing list