Fix a typo
[deliverable/binutils-gdb.git] / binutils / ar.c
index d28419f4f1cafd9cb8db678f14ccfdc5df6c71fa..6cdd1191d3c4a117ecfc93d3a4ff7ee23b780326 100644 (file)
@@ -1,6 +1,6 @@
 /* ar.c - Archive modify and extract.
    Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-   2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+   2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
    Free Software Foundation, Inc.
 
    This file is part of GNU Binutils.
 #define EXT_NAME_LEN 6         /* Ditto for *NIX.  */
 #endif
 
-/* Kludge declaration from BFD!  This is ugly!  FIXME!  XXX  */
-
-struct ar_hdr *
-  bfd_special_undocumented_glue (bfd * abfd, const char *filename);
-
 /* Static declarations.  */
 
 static void mri_emul (void);
@@ -278,11 +273,13 @@ usage (int help)
       fprintf (s, _("Usage: %s [options] archive\n"), program_name);
       fprintf (s, _(" Generate an index to speed access to archives\n"));
       fprintf (s, _(" The options are:\n\
-  @<file>                      Read options from <file>\n"
+  @<file>                      Read options from <file>\n"));
 #if BFD_SUPPORTS_PLUGINS
-"  --plugin <name>              Load the specified plugin\n"
+      fprintf (s, _("\
+  --plugin <name>              Load the specified plugin\n"));
 #endif
-"  -t                           Update the archive's symbol map timestamp\n\
+      fprintf (s, _("\
+  -t                           Update the archive's symbol map timestamp\n\
   -h --help                    Print this help message\n\
   -v --version                 Print version information\n"));
     }
@@ -330,7 +327,7 @@ normalize (const char *file, bfd *abfd)
       char *s;
 
       /* Space leak.  */
-      s = xmalloc (abfd->xvec->ar_max_namelen + 1);
+      s = (char *) xmalloc (abfd->xvec->ar_max_namelen + 1);
       memcpy (s, filename, abfd->xvec->ar_max_namelen);
       s[abfd->xvec->ar_max_namelen] = '\0';
       filename = s;
@@ -370,7 +367,7 @@ main (int argc, char **argv)
   char c;
   enum
     {
-      none = 0, delete, replace, print_table,
+      none = 0, del, replace, print_table,
       print_files, extract, move, quick_append
     } operation = none;
   int arg_index;
@@ -392,6 +389,9 @@ main (int argc, char **argv)
 
   program_name = argv[0];
   xmalloc_set_program_name (program_name);
+#if BFD_SUPPORTS_PLUGINS
+  bfd_plugin_set_program_name (program_name);
+#endif
 
   expandargv (&argc, &argv);
 
@@ -535,7 +535,7 @@ main (int argc, char **argv)
              switch (c)
                {
                case 'd':
-                 operation = delete;
+                 operation = del;
                  operation_alters_arch = TRUE;
                  break;
                case 'm':
@@ -668,7 +668,7 @@ main (int argc, char **argv)
 
       if (counted_name_mode)
        {
-         if (operation != extract && operation != delete)
+         if (operation != extract && operation != del)
             fatal (_("`N' is only meaningful with the `x' and `d' options."));
          counted_name_counter = atoi (argv[arg_index++]);
          if (counted_name_counter <= 0)
@@ -700,7 +700,7 @@ main (int argc, char **argv)
          map_over_members (arch, extract_file, files, file_count);
          break;
 
-       case delete:
+       case del:
          if (files != NULL)
            delete_members (arch, files);
          else
@@ -838,7 +838,7 @@ static void
 print_contents (bfd *abfd)
 {
   size_t ncopied = 0;
-  char *cbuf = xmalloc (BUFSIZE);
+  char *cbuf = (char *) xmalloc (BUFSIZE);
   struct stat buf;
   size_t size;
   if (bfd_stat_arch_elt (abfd, &buf) != 0)
@@ -890,7 +890,7 @@ void
 extract_file (bfd *abfd)
 {
   FILE *ostream;
-  char *cbuf = xmalloc (BUFSIZE);
+  char *cbuf = (char *) xmalloc (BUFSIZE);
   size_t nread, tocopy;
   size_t ncopied = 0;
   size_t size;
@@ -984,7 +984,7 @@ write_archive (bfd *iarch)
   char *old_name, *new_name;
   bfd *contents_head = iarch->archive_next;
 
-  old_name = xmalloc (strlen (bfd_get_filename (iarch)) + 1);
+  old_name = (char *) xmalloc (strlen (bfd_get_filename (iarch)) + 1);
   strcpy (old_name, bfd_get_filename (iarch));
   new_name = make_tempname (old_name);
 
@@ -1163,14 +1163,14 @@ move_members (bfd *arch, char **files_to_move)
            {
              /* Move this file to the end of the list - first cut from
                 where it is.  */
-             bfd *link;
+             bfd *link_bfd;
              *current_ptr_ptr = current_ptr->archive_next;
 
              /* Now glue to end */
              after_bfd = get_pos_bfd (&arch->archive_next, pos_end, NULL);
-             link = *after_bfd;
+             link_bfd = *after_bfd;
              *after_bfd = current_ptr;
-             current_ptr->archive_next = link;
+             current_ptr->archive_next = link_bfd;
 
              if (verbose)
                printf ("m - %s\n", *files_to_move);
This page took 0.026102 seconds and 4 git commands to generate.