]> Git Repo - binutils.git/blobdiff - binutils/ar.c
* config/mipsbelf.mt (SELECT_VECS): Add ecoff_big_vec and
[binutils.git] / binutils / ar.c
index 96f4213ec745b10ab913bce7962f5757c3c27f91..19491717b2645b3494514accc048ef6fe44ec695 100644 (file)
@@ -230,11 +230,12 @@ main (argc, argv)
   char *temp;
   int show_version;
 
+  program_name = argv[0];
+  xmalloc_set_program_name (program_name);
+
   bfd_init ();
   show_version = 0;
 
-  program_name = argv[0];
-
   temp = strrchr (program_name, '/');
   if (temp == (char *) NULL)
     temp = program_name;       /* shouldn't happen, but... */
@@ -449,7 +450,7 @@ open_inarch (archive_filename)
   bfd **last_one;
   bfd *next_one;
   struct stat sbuf;
-  bfd_error = no_error;
+  bfd_set_error (bfd_error_no_error);
 
   if (stat (archive_filename, &sbuf) != 0)
     {
@@ -496,7 +497,7 @@ open_inarch (archive_filename)
       last_one = &next_one->next;
     }
   *last_one = (bfd *) NULL;
-  if (bfd_error != no_more_archived_files)
+  if (bfd_get_error () != bfd_error_no_more_archived_files)
     goto bloser;
   return 1;
 }
@@ -643,7 +644,7 @@ do_quick_append (archive_filename, files_to_append)
   bfd *temp;
   struct stat sbuf;
   boolean newfile = false;
-  bfd_error = no_error;
+  bfd_set_error (bfd_error_no_error);
 
   if (stat (archive_filename, &sbuf) != 0)
     {
@@ -727,7 +728,7 @@ do_quick_append (archive_filename, files_to_append)
        }
       fclose (ifile);
       if ((sbuf.st_size % 2) == 1)
-       putc ('\n', ofile);
+       putc ('\012', ofile);
     }
   fclose (ofile);
   bfd_close (temp);
@@ -882,18 +883,21 @@ move_members (files_to_move)
            {
              /* Move this file to the end of the list - first cut from
                 where it is.  */
+             bfd *link;
              *current_ptr_ptr = current_ptr->next;
 
              /* Now glue to end */
              after_bfd = get_pos_bfd (&inarch->next, pos_end);
+             link = *after_bfd;
              *after_bfd = current_ptr;
-             current_ptr->next = (bfd *) NULL;
+             current_ptr->next = link;
 
              if (verbose)
                printf ("m - %s\n", *files_to_move);
 
              goto next_file;
            }
+
          current_ptr_ptr = &((*current_ptr_ptr)->next);
        }
       fprintf (stderr, "%s: no entry %s in archive %s!\n",
This page took 0.026243 seconds and 4 git commands to generate.