#!/usr/bin/sh
# @(#) 92453-07 command s800.sgs ranlib A.10.44 950918
# USAGE: ranlib archive...
# Update a symbol table if the z option of ar was used to add a member without
# updating the archive symbol table.  Execute "ar qs" on each archive.

ERROR_FOUND=0

while [ $# -gt 0 -a "$1" != "--" ]
do
    ar qs -- "$1"
    STATUS=$?
    if [ $STATUS -ne 0 ]
    then
	ERROR_FOUND=$STATUS
    fi
    shift
done

# After seeing "--", another "--" is just a file name.

if [ $# -gt 0 ]
then
    shift
    while [ $# -gt 0 ]
    do
	ar qs -- "$1"
	if [ $? -ne 0 ]
	then
	    ERROR_FOUND=$?
	fi
	shift
    done
fi
exit $ERROR_FOUND
