diff options
author | Steve Chamberlain <sac@cygnus> | 1991-11-09 01:07:40 +0000 |
---|---|---|
committer | Steve Chamberlain <sac@cygnus> | 1991-11-09 01:07:40 +0000 |
commit | bb5ae298fcd30ddac9689777f22a02d82f04fedd (patch) | |
tree | 67e09fc4db25a98790ac1abc1b1fd96247008aec | |
parent | 66f3e59427aad237cabe45430cbd5886ba200c54 (diff) | |
download | gdb-bb5ae298fcd30ddac9689777f22a02d82f04fedd.zip gdb-bb5ae298fcd30ddac9689777f22a02d82f04fedd.tar.gz gdb-bb5ae298fcd30ddac9689777f22a02d82f04fedd.tar.bz2 |
Now runs write_armap, even when listing contents.
-rw-r--r-- | binutils/ar.c | 32 |
1 files changed, 11 insertions, 21 deletions
diff --git a/binutils/ar.c b/binutils/ar.c index 4a504327..dbce590 100644 --- a/binutils/ar.c +++ b/binutils/ar.c @@ -236,7 +236,8 @@ main(argc, argv) } } - if (operation == none && write_armap) + if ((operation == none || operation == print_table) + && write_armap == true) ranlib_only(argv[2]); if (operation == none) @@ -717,31 +718,20 @@ get_pos_bfd(contents, default_pos) bfd **contents; enum pos default_pos; { - bfd **after_bfd; - + bfd **after_bfd = contents; enum pos realpos = (postype == pos_default ? default_pos : postype); - switch (realpos) { - case pos_end: - after_bfd = contents; - while (*after_bfd) { + if (realpos == pos_end) { + while (*after_bfd) after_bfd = &((*after_bfd)->next); + } + else { + for ( ; *after_bfd; after_bfd = &(*after_bfd)->next) + if (!strcmp((*after_bfd)->filename, posname)) { + if (realpos == pos_after) + after_bfd = &(*after_bfd)->next; } - - break; -#if 0 - case pos_after: - for (after_bfd = contents; after_bfd; after_bfd = after_bfd->next) - if (!strcpy(after_bfd->filename, posname)) - break; - break; - case pos_before: - for (after_bfd = contents; after_bfd; after_bfd = after_bfd->next) - if (after_bfd->next && (!strcpy(after_bfd->next->filename, posname))) - break; -#endif } - return after_bfd; } |