--- driver/xscreensaver-getimage-file.orig	Sat Jun 28 19:01:43 2003
+++ driver/xscreensaver-getimage-file	Fri Aug 15 02:46:20 2003
@@ -43,7 +43,7 @@
 # So we do it like this instead:
 #
 BEGIN {
-  if (! defined(&S_ISLNK)) {  # perhaps defined by "POSIX"?
+  if ((! defined(&S_ISLNK)) and ($] > 5.6)) {  # perhaps defined by "POSIX"?
     require Fcntl;
     import  Fcntl ':mode';    # if not, look for it in "Fcntl".
   }
@@ -149,7 +149,7 @@
       push @dirs, $file;
       $dir_count++;
       print STDERR "$progname:   found dir  $file\n" if ($verbose > 2);
-    } elsif (S_ISREG($mode) || S_ISLNK($mode)) {
+    } elsif (S_ISREG($mode) || (-l "$file")) {
 
       if ($file =~ m/[~%\#]$/ ||               # backup file, or
           ! ($file =~ m/$good_file_re/io)) {   # no image extension
