This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Problem with -f option and #APP


Alan Modra wrote:
> 
> On Mon, Sep 24, 2001 at 05:08:59PM -0400, J. Johnston wrote:
> >
> > Ok to check in?
> 
> Yes, seems reasonable to me.  You didn't include a ChangeLog entry with
> your patch.  Please ensure you add a ChangeLog entry when committing, and
> also fix the formatting nits.
> 

I made the space changes you recommended, plus I changed some tabs preceding
code lines into spaces.

I have attached the patch I checked in.  The following was the ChangeLog entry:

2001-09-26  Jeff Johnston  <jjohnstn@redhat.com>

        * input-file.c (input_file_open): When reading the
        first line looking for #NO_APP, prepare for the possibility
        of finding #APP instead.  Also fix algorithm to allow
        white-space to follow either #NO_APP or #APP directives.


-- Jeff J.
Index: input-file.c
===================================================================
RCS file: /cvs/src/src/gas/input-file.c,v
retrieving revision 1.7
diff -u -r1.7 input-file.c
--- input-file.c	2001/08/01 01:44:25	1.7
+++ input-file.c	2001/09/26 20:31:18
@@ -157,19 +157,29 @@
       /* Begins with comment, may not want to preprocess.  */
       c = getc (f_in);
       if (c == 'N')
-	{
-	  fgets (buf, 80, f_in);
-	  if (!strcmp (buf, "O_APP\n"))
-	    preprocess = 0;
-	  if (!strchr (buf, '\n'))
-	    ungetc ('#', f_in);	/* It was longer.  */
-	  else
-	    ungetc ('\n', f_in);
-	}
+        {
+          fgets (buf, 80, f_in);
+          if (!strncmp (buf, "O_APP", 5) && isspace (buf[5]))
+            preprocess = 0;
+          if (!strchr (buf, '\n'))
+            ungetc ('#', f_in);	/* It was longer.  */
+          else
+            ungetc ('\n', f_in);
+        }
+      else if (c == 'A')
+        {
+          fgets (buf, 80, f_in);
+          if (!strncmp (buf, "PP", 2) && isspace (buf[2]))
+            preprocess = 1;
+          if (!strchr (buf, '\n'))
+            ungetc ('#', f_in);
+          else
+            ungetc ('\n', f_in);
+        }
       else if (c == '\n')
-	ungetc ('\n', f_in);
+        ungetc ('\n', f_in);
       else
-	ungetc ('#', f_in);
+        ungetc ('#', f_in);
     }
   else
     ungetc (c, f_in);

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]