* read.c: Standardize error/warning messages - don't capitalise, no
[external/binutils.git] / gas / listing.c
index 2c165dc..7aeb3fc 100644 (file)
@@ -1,5 +1,6 @@
 /* listing.c - mainting assembly listings
-   Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000
+   Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+   2001
    Free Software Foundation, Inc.
 
 This file is part of GAS, the GNU Assembler.
@@ -484,7 +485,7 @@ buffer_line (file, line, size)
        }
 
       last_open_file_info = file;
-      last_open_file = fopen (file->filename, "r");
+      last_open_file = fopen (file->filename, FOPEN_RT);
       if (last_open_file == NULL)
        {
          file->at_end = 1;
@@ -1007,6 +1008,8 @@ listing_listing (name)
          show_listing--;
          break;
        case EDICT_NOLIST_NEXT:
+         if (show_listing == 0)
+           list_line--;
          break;
        case EDICT_EJECT:
          break;
@@ -1029,7 +1032,8 @@ listing_listing (name)
            p = buffer_line (list->file, buffer, width);
        }
 
-      if (list->edict == EDICT_LIST)
+      if (list->edict == EDICT_LIST
+         || (list->edict == EDICT_NOLIST_NEXT && show_listing == 0))
        {
          /* Enable listing for the single line that caused the enable.  */
          list_line++;
@@ -1090,7 +1094,7 @@ listing_listing (name)
            }
        }
 
-      if (list->edict == EDICT_NOLIST_NEXT)
+      if (list->edict == EDICT_NOLIST_NEXT && show_listing == 1)
        --show_listing;
 
       list = list->next;
@@ -1117,7 +1121,7 @@ listing_print (name)
     }
   else
     {
-      list_file = fopen (name, "w");
+      list_file = fopen (name, FOPEN_WT);
       if (list_file != NULL)
        using_stdout = 0;
       else
@@ -1291,7 +1295,7 @@ listing_title (depth)
        }
       else if (*input_line_pointer == '\n')
        {
-         as_bad (_("New line in title"));
+         as_bad (_("new line in title"));
          demand_empty_rest_of_line ();
          return;
        }