Fix typo
[deliverable/binutils-gdb.git] / gas / gasp.c
index 2cb4877343be6bba0933c2bdca2b9a5e76fc4c7d..f8e435388923fed121ca15fe99661133d101ef59 100644 (file)
@@ -1,5 +1,5 @@
 /* gasp.c - Gnu assembler preprocessor main program.
-   Copyright (C) 1994, 1995 Free Software Foundation, Inc.
+   Copyright (C) 1994, 95, 96, 97, 1998 Free Software Foundation, Inc.
 
    Written by Steve and Judy Chamberlain of Cygnus Support,
       sac@cygnus.com
@@ -67,9 +67,15 @@ extern char *malloc ();
 #include "libiberty.h"
 #include "sb.h"
 #include "macro.h"
+#include "asintl.h"
 
 char *program_version = "1.2";
 
+/* This is normally declared in as.h, but we don't include that.  We
+   need the function because other files linked with gasp.c might call
+   it.  */
+extern void as_abort PARAMS ((const char *, int, const char *));
+
 #define MAX_INCLUDES 30                /* Maximum include depth */
 #define MAX_REASONABLE 1000    /* Maximum number of expansions */
 
@@ -100,12 +106,12 @@ FILE *outfile;
 #define WHITEBIT 8
 #define COMMENTBIT 16
 #define BASEBIT  32
-#define ISCOMMENTCHAR(x) (chartype[(unsigned)(x)] & COMMENTBIT)
-#define ISFIRSTCHAR(x)  (chartype[(unsigned)(x)] & FIRSTBIT)
-#define ISNEXTCHAR(x)   (chartype[(unsigned)(x)] & NEXTBIT)
-#define ISSEP(x)        (chartype[(unsigned)(x)] & SEPBIT)
-#define ISWHITE(x)      (chartype[(unsigned)(x)] & WHITEBIT)
-#define ISBASE(x)       (chartype[(unsigned)(x)] & BASEBIT)
+#define ISCOMMENTCHAR(x) (chartype[(unsigned char)(x)] & COMMENTBIT)
+#define ISFIRSTCHAR(x)  (chartype[(unsigned char)(x)] & FIRSTBIT)
+#define ISNEXTCHAR(x)   (chartype[(unsigned char)(x)] & NEXTBIT)
+#define ISSEP(x)        (chartype[(unsigned char)(x)] & SEPBIT)
+#define ISWHITE(x)      (chartype[(unsigned char)(x)] & WHITEBIT)
+#define ISBASE(x)       (chartype[(unsigned char)(x)] & BASEBIT)
 static char chartype[256];
 
 
@@ -470,7 +476,7 @@ hash_add_to_string_table (tab, key, name, again)
   if (ptr->value.s.len)
     {
       if (!again)
-       ERROR ((stderr, "redefintion not allowed"));
+       ERROR ((stderr, _("redefinition not allowed\n")));
     }
 
   ptr->type = hash_string;
@@ -544,7 +550,7 @@ checkconst (op, term)
   if (term->add_symbol.len
       || term->sub_symbol.len)
     {
-      ERROR ((stderr, "the %c operator cannot take non-absolute arguments.\n", op));
+      ERROR ((stderr, _("the %c operator cannot take non-absolute arguments.\n"), op));
     }
 }
 
@@ -602,7 +608,7 @@ level_0 (idx, string, lhs)
 
   lhs->value = 0;
 
-  if (isdigit (string->ptr[idx]))
+  if (isdigit ((unsigned char) string->ptr[idx]))
     {
       idx = sb_strtol (idx, string, 10, &lhs->value);
     }
@@ -621,13 +627,13 @@ level_0 (idx, string, lhs)
     {
       sb acc;
       sb_new (&acc);
-      ERROR ((stderr, "string where expression expected.\n"));
+      ERROR ((stderr, _("string where expression expected.\n")));
       idx = getstring (idx, string, &acc);
       sb_kill (&acc);
     }
   else
     {
-      ERROR ((stderr, "can't find primary in expression.\n"));
+      ERROR ((stderr, _("can't find primary in expression.\n")));
       idx++;
     }
   return sb_skip_white (idx, string);
@@ -667,7 +673,7 @@ level_1 (idx, string, lhs)
       idx++;
       idx = level_5 (sb_skip_white (idx, string), string, lhs);
       if (string->ptr[idx] != ')')
-       ERROR ((stderr, "misplaced closing parens.\n"));
+       ERROR ((stderr, _("misplaced closing parens.\n")));
       else
        idx++;
       break;
@@ -704,7 +710,7 @@ level_2 (idx, string, lhs)
          checkconst ('/', lhs);
          checkconst ('/', &rhs);
          if (rhs.value == 0)
-           ERROR ((stderr, "attempt to divide by zero.\n"));
+           ERROR ((stderr, _("attempt to divide by zero.\n")));
          else
            lhs->value /= rhs.value;
          break;
@@ -736,7 +742,7 @@ level_3 (idx, string, lhs)
          lhs->value += rhs.value;
          if (lhs->add_symbol.name && rhs.add_symbol.name)
            {
-             ERROR ((stderr, "can't add two relocatable expressions\n"));
+             ERROR ((stderr, _("can't add two relocatable expressions\n")));
            }
          /* change nn+symbol to symbol + nn */
          if (rhs.add_symbol.name)
@@ -941,7 +947,7 @@ include_buf (name, ptr, type, index)
 {
   sp++;
   if (sp - include_stack >= MAX_INCLUDES)
-    FATAL ((stderr, "unreasonable nesting.\n"));
+    FATAL ((stderr, _("unreasonable nesting.\n")));
   sb_new (&sp->name);
   sb_add_sb (&sp->name, name);
   sp->handle = 0;
@@ -1019,7 +1025,7 @@ get_line (in)
        {
          if (online)
            {
-             WARNING ((stderr, "End of file not at start of line.\n"));
+             WARNING ((stderr, _("End of file not at start of line.\n")));
              if (copysource)
                putc ('\n', outfile);
              ch = '\n';
@@ -1140,7 +1146,7 @@ change_base (idx, in, out)
              base = 10;
              break;
            default:
-             ERROR ((stderr, "Illegal base character %c.\n", in->ptr[idx]));
+             ERROR ((stderr, _("Illegal base character %c.\n"), in->ptr[idx]));
              base = 10;
              break;
            }
@@ -1160,7 +1166,7 @@ change_base (idx, in, out)
              idx++;
            }
        }
-      else if (isdigit (in->ptr[idx]))
+      else if (isdigit ((unsigned char) in->ptr[idx]))
        {
          int value;
          /* all numbers must start with a digit, let's chew it and
@@ -1255,7 +1261,7 @@ do_radix (ptr)
       radix = 16;
       break;
     default:
-      ERROR ((stderr, "radix is %c must be one of b, q, d or h", radix));
+      ERROR ((stderr, _("radix is %c must be one of b, q, d or h"), radix));
     }
 }
 
@@ -1291,7 +1297,7 @@ get_opsize (idx, in, size)
     case '\t':
       break;
     default:
-      ERROR ((stderr, "size must be one of b, w or l, is %c.\n", in->ptr[idx]));
+      ERROR ((stderr, _("size must be one of b, w or l, is %c.\n"), in->ptr[idx]));
       break;
     }
   idx++;
@@ -1399,9 +1405,9 @@ do_datab (idx, in)
 
   idx = get_opsize (idx, in, &opsize);
 
-  idx = exp_get_abs ("datab repeat must be constant.\n", idx, in, &repeat);
+  idx = exp_get_abs (_("datab repeat must be constant.\n"), idx, in, &repeat);
   idx = sb_skip_comma (idx, in);
-  idx = exp_get_abs ("datab data must be absolute.\n", idx, in, &fill);
+  idx = exp_get_abs (_("datab data must be absolute.\n"), idx, in, &fill);
 
   fprintf (outfile, ".fill\t%d,%d,%d\n", repeat, opsize, fill);
 }
@@ -1415,14 +1421,14 @@ do_align (idx, in)
 {
   int al, have_fill, fill;
 
-  idx = exp_get_abs ("align needs absolute expression.\n", idx, in, &al);
+  idx = exp_get_abs (_("align needs absolute expression.\n"), idx, in, &al);
   idx = sb_skip_white (idx, in);
   have_fill = 0;
   fill = 0;
   if (! eol (idx, in))
     {
       idx = sb_skip_comma (idx, in);
-      idx = exp_get_abs (".align needs absolute fill value.\n", idx, in,
+      idx = exp_get_abs (_(".align needs absolute fill value.\n"), idx, in,
                         &fill);
       have_fill = 1;
     }
@@ -1430,7 +1436,7 @@ do_align (idx, in)
   if (al != 1
       && al != 2
       && al != 4)
-    WARNING ((stderr, "alignment must be one of 1, 2 or 4.\n"));
+    WARNING ((stderr, _("alignment must be one of 1, 2 or 4.\n")));
 
   fprintf (outfile, ".align    %d", al);
   if (have_fill)
@@ -1455,7 +1461,7 @@ do_res (idx, in, type)
       idx = sb_skip_white (idx, in);
       if (in->ptr[idx] == ',')
        idx++;
-      idx = exp_get_abs ("res needs absolute expression for fill count.\n", idx, in, &count);
+      idx = exp_get_abs (_("res needs absolute expression for fill count.\n"), idx, in, &count);
 
       if (type == 'c' || type == 'z')
        count++;
@@ -1535,13 +1541,13 @@ do_form (idx, in)
       if (strncasecmp (in->ptr + idx, "LIN=", 4) == 0)
        {
          idx += 4;
-         idx = exp_get_abs ("form LIN= needs absolute expresssion.\n", idx, in, &lines);
+         idx = exp_get_abs (_("form LIN= needs absolute expresssion.\n"), idx, in, &lines);
        }
 
-      if (strncasecmp (in->ptr + idx, "COL=", 4) == 0)
+      if (strncasecmp (in->ptr + idx, _("COL="), 4) == 0)
        {
          idx += 4;
-         idx = exp_get_abs ("form COL= needs absolute expresssion.\n", idx, in, &columns);
+         idx = exp_get_abs (_("form COL= needs absolute expresssion.\n"), idx, in, &columns);
        }
 
       idx++;
@@ -1583,7 +1589,7 @@ get_any_string (idx, in, out, expand, pretend_quoted)
          int val;
          char buf[20];
          /* Turns the next expression into a string */
-         idx = exp_get_abs ("% operator needs absolute expression",
+         idx = exp_get_abs (_("% operator needs absolute expression"),
                             idx + 1,
                             in,
                             &val);
@@ -1645,7 +1651,7 @@ skip_openp (idx, in)
 {
   idx = sb_skip_white (idx, in);
   if (in->ptr[idx] != '(')
-    ERROR ((stderr, "misplaced ( .\n"));
+    ERROR ((stderr, _("misplaced ( .\n")));
   idx = sb_skip_white (idx + 1, in);
   return idx;
 }
@@ -1660,7 +1666,7 @@ skip_closep (idx, in)
 {
   idx = sb_skip_white (idx, in);
   if (in->ptr[idx] != ')')
-    ERROR ((stderr, "misplaced ).\n"));
+    ERROR ((stderr, _("misplaced ).\n")));
   idx = sb_skip_white (idx + 1, in);
   return idx;
 }
@@ -1712,9 +1718,9 @@ doinstr (idx, in, out)
   idx = sb_skip_comma (idx, in);
   idx = get_and_process (idx, in, &search);
   idx = sb_skip_comma (idx, in);
-  if (isdigit (in->ptr[idx]))
+  if (isdigit ((unsigned char) in->ptr[idx]))
     {
-      idx = exp_get_abs (".instr needs absolute expresson.\n", idx, in, &start);
+      idx = exp_get_abs (_(".instr needs absolute expresson.\n"), idx, in, &start);
     }
   else
     {
@@ -1752,9 +1758,9 @@ dosubstr (idx, in, out)
   idx = skip_openp (idx, in);
   idx = get_and_process (idx, in, &string);
   idx = sb_skip_comma (idx, in);
-  idx = exp_get_abs ("need absolute position.\n", idx, in, &pos);
+  idx = exp_get_abs (_("need absolute position.\n"), idx, in, &pos);
   idx = sb_skip_comma (idx, in);
-  idx = exp_get_abs ("need absolute length.\n", idx, in, &len);
+  idx = exp_get_abs (_("need absolute length.\n"), idx, in, &len);
   idx = skip_closep (idx, in);
 
 
@@ -1917,19 +1923,43 @@ process_file ()
        {
          l = grab_label (&line, &label_in);
          sb_reset (&label);              
-         if (label_in.len)
-           {
-             /* Munge any label */
-
-             
-             process_assigns (0, &label_in, &label);
-           }
 
          if (line.ptr[l] == ':')
            l++;
          while (ISWHITE (line.ptr[l]) && l < line.len)
            l++;
 
+         if (label_in.len)
+           {
+             int do_assigns;
+
+             /* Munge the label, unless this is EQU or ASSIGN.  */
+             do_assigns = 1;
+             if (l < line.len
+                 && (line.ptr[l] == '.' || alternate || mri))
+               {
+                 int lx = l;
+
+                 if (line.ptr[lx] == '.')
+                   ++lx;
+                 if (lx + 3 <= line.len
+                     && strncasecmp ("EQU", line.ptr + lx, 3) == 0
+                     && (lx + 3 == line.len
+                         || ! ISFIRSTCHAR (line.ptr[lx + 3])))
+                   do_assigns = 0;
+                 else if (lx + 6 <= line.len
+                          && strncasecmp ("ASSIGN", line.ptr + lx, 6) == 0
+                          && (lx + 6 == line.len
+                              || ! ISFIRSTCHAR (line.ptr[lx + 6])))
+                   do_assigns = 0;
+               }
+
+             if (do_assigns)
+               process_assigns (0, &label_in, &label);
+             else
+               sb_add_sb (&label, &label_in);
+           }
+
          if (l < line.len)
            {
              if (process_pseudo_op (l, &line, &acc))
@@ -1979,7 +2009,7 @@ process_file ()
     }
 
   if (!had_end && !mri)
-    WARNING ((stderr, "END missing from end of file.\n"));
+    WARNING ((stderr, _("END missing from end of file.\n")));
 }
 
 
@@ -2009,11 +2039,11 @@ do_assigna (idx, in)
   sb_new (&tmp);
 
   process_assigns (idx, in, &tmp);
-  idx = exp_get_abs (".ASSIGNA needs constant expression argument.\n", 0, &tmp, &val);
+  idx = exp_get_abs (_(".ASSIGNA needs constant expression argument.\n"), 0, &tmp, &val);
 
   if (!label.len)
     {
-      ERROR ((stderr, ".ASSIGNA without label.\n"));
+      ERROR ((stderr, _(".ASSIGNA without label.\n")));
     }
   else
     {
@@ -2038,7 +2068,7 @@ do_assignc (idx, in)
 
   if (!label.len)
     {
-      ERROR ((stderr, ".ASSIGNS without label.\n"));
+      ERROR ((stderr, _(".ASSIGNS without label.\n")));
     }
   else
     {
@@ -2105,7 +2135,7 @@ condass_lookup_name (inbuf, idx, out, warn)
     {
       if (warn) 
        {
-         WARNING ((stderr, "Can't find preprocessor variable %s.\n", sb_name (&condass_acc)));
+         WARNING ((stderr, _("Can't find preprocessor variable %s.\n"), sb_name (&condass_acc)));
        }
       else 
        {
@@ -2170,7 +2200,7 @@ whatcond (idx, in, val)
     }
   if (cond == NEVER)
     {
-      ERROR ((stderr, "Comparison operator must be one of EQ, NE, LT, LE, GT or GE.\n"));
+      ERROR ((stderr, _("Comparison operator must be one of EQ, NE, LT, LE, GT or GE.\n")));
       cond = NEVER;
     }
   idx = sb_skip_white (idx + 2, in);
@@ -2204,7 +2234,7 @@ istrue (idx, in)
 
       if (cond != EQ && cond != NE)
        {
-         ERROR ((stderr, "Comparison operator for strings must be EQ or NE\n"));
+         ERROR ((stderr, _("Comparison operator for strings must be EQ or NE\n")));
          res = 0;
        }
       else
@@ -2216,17 +2246,17 @@ istrue (idx, in)
       int vala;
       int valb;
       int cond;
-      idx = exp_get_abs ("Conditional operator must have absolute operands.\n", idx, in, &vala);
+      idx = exp_get_abs (_("Conditional operator must have absolute operands.\n"), idx, in, &vala);
       idx = whatcond (idx, in, &cond);
       idx = sb_skip_white (idx, in);
       if (in->ptr[idx] == '"')
        {
-         WARNING ((stderr, "String compared against expression.\n"));
+         WARNING ((stderr, _("String compared against expression.\n")));
          res = 0;
        }
       else
        {
-         idx = exp_get_abs ("Conditional operator must have absolute operands.\n", idx, in, &valb);
+         idx = exp_get_abs (_("Conditional operator must have absolute operands.\n"), idx, in, &valb);
          switch (cond)
            {
            default:
@@ -2271,7 +2301,7 @@ do_aif (idx, in)
 {
   if (ifi >= IFNESTING)
     {
-      FATAL ((stderr, "AIF nesting unreasonable.\n"));
+      FATAL ((stderr, _("AIF nesting unreasonable.\n")));
     }
   ifi++;
   ifstack[ifi].on = ifstack[ifi-1].on ? istrue (idx, in) : 0;
@@ -2286,7 +2316,7 @@ do_aelse ()
   ifstack[ifi].on = ifstack[ifi-1].on ? !ifstack[ifi].on : 0;
   if (ifstack[ifi].hadelse)
     {
-      ERROR ((stderr, "Multiple AELSEs in AIF.\n"));
+      ERROR ((stderr, _("Multiple AELSEs in AIF.\n")));
     }
   ifstack[ifi].hadelse = 1;
 }
@@ -2302,7 +2332,7 @@ do_aendi ()
     }
   else
     {
-      ERROR ((stderr, "AENDI without AIF.\n"));
+      ERROR ((stderr, _("AENDI without AIF.\n")));
     }
 }
 
@@ -2325,10 +2355,10 @@ do_if (idx, in, cond)
 
   if (ifi >= IFNESTING)
     {
-      FATAL ((stderr, "IF nesting unreasonable.\n"));
+      FATAL ((stderr, _("IF nesting unreasonable.\n")));
     }
 
-  idx = exp_get_abs ("Conditional operator must have absolute operands.\n",
+  idx = exp_get_abs (_("Conditional operator must have absolute operands.\n"),
                     idx, in, &val);
   switch (cond)
     {
@@ -2407,7 +2437,7 @@ do_ifc (idx, in, ifnc)
 
   if (ifi >= IFNESTING)
     {
-      FATAL ((stderr, "IF nesting unreasonable.\n"));
+      FATAL ((stderr, _("IF nesting unreasonable.\n")));
     }
 
   sb_new (&first);
@@ -2417,7 +2447,7 @@ do_ifc (idx, in, ifnc)
 
   if (idx >= in->len || in->ptr[idx] != ',')
     {
-      ERROR ((stderr, "Bad format for IF or IFNC.\n"));
+      ERROR ((stderr, _("Bad format for IF or IFNC.\n")));
       return;
     }
 
@@ -2437,9 +2467,9 @@ static void
 do_aendr ()
 {
   if (!mri)
-    ERROR ((stderr, "AENDR without a AREPEAT.\n"));
+    ERROR ((stderr, _("AENDR without a AREPEAT.\n")));
   else
-    ERROR ((stderr, "ENDR without a REPT.\n"));
+    ERROR ((stderr, _("ENDR without a REPT.\n")));
 }
 
 /* .AWHILE */
@@ -2462,7 +2492,7 @@ do_awhile (idx, in)
   doit = istrue (0, &exp);
 
   if (! buffer_and_nest ("AWHILE", "AENDW", &sub, get_line))
-    FATAL ((stderr, "AWHILE without a AENDW at %d.\n", line - 1));
+    FATAL ((stderr, _("AWHILE without a AENDW at %d.\n"), line - 1));
 
   /* Turn
        .AWHILE exp
@@ -2500,7 +2530,7 @@ do_awhile (idx, in)
 static void
 do_aendw ()
 {
-  ERROR ((stderr, "AENDW without a AENDW.\n"));
+  ERROR ((stderr, _("AENDW without a AENDW.\n")));
 }
 
 
@@ -2545,13 +2575,13 @@ do_arepeat (idx, in)
   sb_new (&copy);
   sb_new (&sub);
   process_assigns (idx, in, &exp);
-  idx = exp_get_abs ("AREPEAT must have absolute operand.\n", 0, &exp, &rc);
+  idx = exp_get_abs (_("AREPEAT must have absolute operand.\n"), 0, &exp, &rc);
   if (!mri)
     ret = buffer_and_nest ("AREPEAT", "AENDR", &sub, get_line);
   else
     ret = buffer_and_nest ("REPT", "ENDR", &sub, get_line);
   if (! ret)
-    FATAL ((stderr, "AREPEAT without a AENDR at %d.\n", line - 1));
+    FATAL ((stderr, _("AREPEAT without a AENDR at %d.\n"), line - 1));
   if (rc > 0)
     {
       /* Push back the text following the repeat, and another repeat block
@@ -2593,7 +2623,7 @@ do_arepeat (idx, in)
 static void
 do_endm ()
 {
-  ERROR ((stderr, ".ENDM without a matching .MACRO.\n"));
+  ERROR ((stderr, _(".ENDM without a matching .MACRO.\n")));
 }
 
 /* MRI IRP pseudo-op.  */
@@ -2627,7 +2657,7 @@ do_local (idx, line)
      int idx;
      sb *line;
 {
-  ERROR ((stderr, "LOCAL outside of MACRO"));
+  ERROR ((stderr, _("LOCAL outside of MACRO")));
 }
 
 static void
@@ -2638,9 +2668,9 @@ do_macro (idx, in)
   const char *err;
   int line = linecount ();
 
-  err = define_macro (idx, in, &label, get_line);
+  err = define_macro (idx, in, &label, get_line, (const char **) NULL);
   if (err != NULL)
-    ERROR ((stderr, "macro at line %d: %s\n", line - 1, err));
+    ERROR ((stderr, _("macro at line %d: %s\n"), line - 1, err));
 }
 
 static int
@@ -2663,7 +2693,7 @@ macro_op (idx, in)
     ERROR ((stderr, "%s\n", err));
 
   sb_new (&name);
-  sb_add_string (&name, "macro expansion");
+  sb_add_string (&name, _("macro expansion"));
 
   include_buf (&name, &out, include_macro, include_next_index ());
 
@@ -2715,12 +2745,12 @@ getstring (idx, in, acc)
          else {
            int code;
            idx++;
-           idx = exp_get_abs ("Character code in string must be absolute expression.\n",
+           idx = exp_get_abs (_("Character code in string must be absolute expression.\n"),
                               idx, in, &code);
            sb_add_char (acc, code);
 
            if (in->ptr[idx] != '>')
-             ERROR ((stderr, "Missing > for character code.\n"));
+             ERROR ((stderr, _("Missing > for character code.\n")));
            idx++;
          }
        }
@@ -2779,7 +2809,7 @@ do_sdata (idx, in, type)
            {
              if (acc.len > 255)
                {
-                 ERROR ((stderr, "string for SDATAC longer than 255 characters (%d).\n", acc.len));
+                 ERROR ((stderr, _("string for SDATAC longer than 255 characters (%d).\n"), acc.len));
                }
              fprintf (outfile, "%d", acc.len);
              nc = 1;
@@ -2807,7 +2837,7 @@ do_sdata (idx, in, type)
       if (!alternate && in->ptr[idx] != ',' && idx != in->len)
        {
          fprintf (outfile, "\n");
-         ERROR ((stderr, "illegal character in SDATA line (0x%x).\n", in->ptr[idx]));
+         ERROR ((stderr, _("illegal character in SDATA line (0x%x).\n"), in->ptr[idx]));
          break;
        }
       idx++;
@@ -2828,10 +2858,10 @@ do_sdatab (idx, in)
   sb acc;
   sb_new (&acc);
 
-  idx = exp_get_abs ("Must have absolute SDATAB repeat count.\n", idx, in, &repeat);
+  idx = exp_get_abs (_("Must have absolute SDATAB repeat count.\n"), idx, in, &repeat);
   if (repeat <= 0)
     {
-      ERROR ((stderr, "Must have positive SDATAB repeat count (%d).\n", repeat));
+      ERROR ((stderr, _("Must have positive SDATAB repeat count (%d).\n"), repeat));
       repeat = 1;
     }
 
@@ -2859,7 +2889,7 @@ new_file (name)
     return 0;
 
   if (isp == MAX_INCLUDES)
-    FATAL ((stderr, "Unreasonable include depth (%ld).\n", (long) isp));
+    FATAL ((stderr, _("Unreasonable include depth (%ld).\n"), (long) isp));
 
   sp++;
   sp->handle = newone;
@@ -2913,7 +2943,7 @@ do_include (idx, in)
   if (!includes)
     {
       if (! new_file (sb_name (&t)))
-       FATAL ((stderr, "Can't open include file `%s'.\n", sb_name (&t)));
+       FATAL ((stderr, _("Can't open include file `%s'.\n"), sb_name (&t)));
     }
   sb_kill (&cat);
   sb_kill (&t);
@@ -2987,7 +3017,7 @@ include_next_index ()
   static int index;
   if (!unreasonable
       && index > MAX_REASONABLE)
-    FATAL ((stderr, "Unreasonable expansion (-u turns off check).\n"));
+    FATAL ((stderr, _("Unreasonable expansion (-u turns off check).\n")));
   return ++index;
 }
 
@@ -3208,7 +3238,7 @@ process_pseudo_op (idx, line, acc)
 #if 0
          /* This one causes lots of pain when trying to preprocess
             ordinary code */
-         WARNING ((stderr, "Unrecognised pseudo op `%s'.\n", sb_name (acc)));
+         WARNING ((stderr, _("Unrecognised pseudo op `%s'.\n"), sb_name (acc)));
 #endif
          return 0;
        }
@@ -3275,7 +3305,7 @@ process_pseudo_op (idx, line, acc)
              do_aendi ();
              return 1;
            case K_ORG:
-             ERROR ((stderr, "ORG command not allowed.\n"));
+             ERROR ((stderr, _("ORG command not allowed.\n")));
              break;
            case K_RADIX:
              do_radix (line);
@@ -3308,7 +3338,7 @@ process_pseudo_op (idx, line, acc)
              do_sdata (idx, line, 'z');
              return 1;
            case K_ASSIGN:
-             do_assign (1, 0, line);
+             do_assign (0, 0, line);
              return 1;
            case K_AIF:
              do_aif (idx, line);
@@ -3326,7 +3356,7 @@ process_pseudo_op (idx, line, acc)
              do_aendr ();
              return 1;
            case K_EQU:
-             do_assign (0, idx, line);
+             do_assign (1, idx, line);
              return 1;
            case K_ALIGN:
              do_align (idx, line);
@@ -3492,7 +3522,7 @@ do_define (string)
              sb_add_char (&value, *string);
              string++;
            }
-         exp_get_abs ("Invalid expression on command line.\n", 0, &value, &res);
+         exp_get_abs (_("Invalid expression on command line.\n"), 0, &value, &res);
          sb_kill (&value);
          break;
        }
@@ -3533,7 +3563,7 @@ show_usage (file, status)
      FILE *file;
      int status;
 {
-  fprintf (file, "\
+  fprintf (file, _("\
 Usage: %s \n\
   [-a]      [--alternate]         enter alternate macro mode\n\
   [-c char] [--commentchar char]  change the comment character from !\n\
@@ -3541,16 +3571,16 @@ Usage: %s \n\
   [-h]      [--help]              print this message\n\
   [-M]      [--mri]               enter MRI compatibility mode\n\
   [-o out]  [--output out]        set the output file\n\
-  [-p]      [--print]             print line numbers\n", program_name);
-  fprintf (file, "\
+  [-p]      [--print]             print line numbers\n"), program_name);
+  fprintf (file, _("\
   [-s]      [--copysource]        copy source through as comments \n\
   [-u]      [--unreasonable]      allow unreasonable nesting\n\
   [-v]      [--version]           print the program version\n\
   [-Dname=value]                  create preprocessor variable called name, with value\n\
   [-Ipath]                        add to include path list\n\
-  [in-file]\n");
+  [in-file]\n"));
   if (status == 0)
-    printf ("\nReport bugs to bug-gnu-utils@prep.ai.mit.edu\n");
+    printf (_("\nReport bugs to bug-gnu-utils@gnu.org\n"));
   exit (status);
 }
 
@@ -3558,7 +3588,7 @@ Usage: %s \n\
 static void
 show_help ()
 {
-  printf ("%s: Gnu Assembler Macro Preprocessor\n",
+  printf (_("%s: Gnu Assembler Macro Preprocessor\n"),
          program_name);
   show_usage (stdout, 0);
 }
@@ -3575,7 +3605,11 @@ main (argc, argv)
   ifstack[0].on = 1;
   ifi = 0;
 
-
+#ifdef HAVE_SETLOCALE
+  setlocale (LC_MESSAGES, "");
+#endif
+  bindtextdomain (PACKAGE, LOCALEDIR);
+  textdomain (PACKAGE);
 
   program_name = argv[0];
   xmalloc_set_program_name (program_name);
@@ -3601,6 +3635,7 @@ main (argc, argv)
        case 'I':
          {
            include_path *p = (include_path *) xmalloc (sizeof (include_path));
+           p->next = NULL;
            sb_new (&p->path);
            sb_add_string (&p->path, optarg);
            if (paths_tail)
@@ -3637,11 +3672,11 @@ main (argc, argv)
          /*NOTREACHED*/
        case 'v':
          /* This output is intended to follow the GNU standards document.  */
-         printf ("GNU assembler pre-processor %s\n", program_version);
-         printf ("Copyright 1996 Free Software Foundation, Inc.\n");
-         printf ("\
+         printf (_("GNU assembler pre-processor %s\n"), program_version);
+         printf (_("Copyright 1996 Free Software Foundation, Inc.\n"));
+         printf (_("\
 This program is free software; you may redistribute it under the terms of\n\
-the GNU General Public License.  This program has absolutely no warranty.\n");
+the GNU General Public License.  This program has absolutely no warranty.\n"));
          exit (0);
          /*NOTREACHED*/
        case 0:
@@ -3660,7 +3695,7 @@ the GNU General Public License.  This program has absolutely no warranty.\n");
     outfile = fopen (out_name, "w");
     if (!outfile)
       {
-       fprintf (stderr, "%s: Can't open output file `%s'.\n",
+       fprintf (stderr, _("%s: Can't open output file `%s'.\n"),
                 program_name, out_name);
        exit (1);
       }
@@ -3683,7 +3718,7 @@ the GNU General Public License.  This program has absolutely no warranty.\n");
        }
       else
        {
-         fprintf (stderr, "%s: Can't open input file `%s'.\n",
+         fprintf (stderr, _("%s: Can't open input file `%s'.\n"),
                   program_name, argv[optind]);
          exit (1);
        }
@@ -3702,9 +3737,9 @@ as_abort (file, line, fn)
      const char *file, *fn;
      int line;
 {
-  fprintf (stderr, "Internal error, aborting at %s line %d", file, line);
+  fprintf (stderr, _("Internal error, aborting at %s line %d"), file, line);
   if (fn)
     fprintf (stderr, " in %s", fn);
-  fprintf (stderr, "\nPlease report this bug.\n");
+  fprintf (stderr, _("\nPlease report this bug.\n"));
   exit (1);
 }
This page took 0.053639 seconds and 4 git commands to generate.