RT2772 update: c_rehash was broken
authorRich Salz <rsalz@openssl.org>
Thu, 11 Sep 2014 17:08:30 +0000 (13:08 -0400)
committerRich Salz <rsalz@openssl.org>
Thu, 11 Sep 2014 17:08:30 +0000 (13:08 -0400)
Move the readdir() lines out of the if statement, so
that flist is available globally.

Reviewed-by: Tim Hudson <tjh@openssl.org>
tools/c_rehash.in

index cd2cc39f271f6eb789dc97d8ef476d7d6a55eb18..887e9271254e49857e8bee23aaed9e79a971df27 100644 (file)
@@ -93,10 +93,10 @@ sub hash_dir {
        my %hashlist;
        print "Doing $_[0]\n";
        chdir $_[0];
+       opendir(DIR, ".");
+       my @flist = readdir(DIR);
+       closedir DIR;
        if ( $removelinks ) {
-               opendir(DIR, ".");
-               my @flist = readdir(DIR);
-               closedir DIR;
                # Delete any existing symbolic links
                foreach (grep {/^[\da-f]+\.r{0,1}\d+$/} @flist) {
                        if(-l $_) {