--- misc/xine-check	2004-02-17 20:56:16.000000000 +0000
+++ misc/xine-check	2004-02-17 20:56:16.000000000 +0000
@@ -567,6 +567,7 @@
     short=
     description=
     tmpfile=/tmp/xine-check-dsc.$$
+    check_tmpfile;
     true >$tmpfile
     cat $messagefile | while read line; do
 	if $found; then
@@ -714,6 +715,45 @@
   read answer
 }
 
+check_bugreport() {
+  if test -f "$bugreport"; then
+    echo "Hmmm, I already found a bug report in ${bugreport}."
+    if yesno "Do you want me to overwrite that file?"; then
+      rm "$bugreport" || clean_exit 1
+    else
+      echo "Okay, aborting on your request."
+      clean_exit 0
+    fi
+  fi
+
+  if test -h "$bugreport"; then
+    echo "Hmmm, I already found another file in ${bugreport}."
+    if yesno "Do you want me to try to overwrite that file?"; then
+      rm "$bugreport" || clean_exit 1
+    else
+      echo "Okay, aborting on your request."
+      clean_exit 0
+    fi
+  fi
+}
+
+check_logfile() {
+  if test -h "$logfile"; then
+    echo "Hmmm, I already found another file in ${logfile}."
+    if yesno "Do you want me to try to overwrite that file?"; then
+      rm "$logfile" || clean_exit 1
+    else
+      echo "Okay, aborting on your request."
+      clean_exit 0
+    fi
+  fi
+}
+
+check_tmpfile() {
+  if test -h "$tmpfile"; then
+    rm "$tmpfile" || clean_exit 1
+  fi
+}
 
 # command line
 while [ "$#" -gt 0 ]; do
@@ -763,12 +803,11 @@
 if [ "$runmode" = "bugreport" ]; then
   do_log=true
   logfile=/tmp/xine-check.log
+  check_logfile;
   echo logging to ${logfile}...
   echo >$logfile
 fi
 
-
-
 ## actual checks start here:
 
 case `id` in
@@ -1173,16 +1212,6 @@
   clean_exit 0    
 fi
 
-if test -f "$bugreport"; then
-  echo "Hmmm, I already found a bug report in ${bugreport}."
-  if yesno "Do you want me to overwrite that file?"; then
-    rm "$bugreport"
-  else
-    echo "Okay, aborting on your request."
-    clean_exit 0
-  fi
-fi
-  
 echo
 echo
 if yesno "Could you solve your xine problems using the previous hints?"; then
@@ -1190,6 +1219,8 @@
   clean_exit
 fi
 
+check_bugreport;
+
 echo
 echo "What kind of trouble does xine cause for you?"
 echo
--- misc/xine-check.sh.in	2004-02-17 20:56:16.000000000 +0000
+++ misc/xine-check.sh.in	2004-02-17 20:56:16.000000000 +0000
@@ -567,6 +567,7 @@
     short=
     description=
     tmpfile=/tmp/xine-check-dsc.$$
+    check_tmpfile;
     true >$tmpfile
     cat $messagefile | while read line; do
 	if $found; then
@@ -714,6 +715,45 @@
   read answer
 }
 
+check_bugreport() {
+  if test -f "$bugreport"; then
+    echo "Hmmm, I already found a bug report in ${bugreport}."
+    if yesno "Do you want me to overwrite that file?"; then
+      rm "$bugreport" || clean_exit 1
+    else
+      echo "Okay, aborting on your request."
+      clean_exit 0
+    fi
+  fi
+
+  if test -h "$bugreport"; then
+    echo "Hmmm, I already found another file in ${bugreport}."
+    if yesno "Do you want me to try to overwrite that file?"; then
+      rm "$bugreport" || clean_exit 1
+    else
+      echo "Okay, aborting on your request."
+      clean_exit 0
+    fi
+  fi
+}
+
+check_logfile() {
+  if test -h "$logfile"; then
+    echo "Hmmm, I already found another file in ${logfile}."
+    if yesno "Do you want me to try to overwrite that file?"; then
+      rm "$logfile" || clean_exit 1
+    else
+      echo "Okay, aborting on your request."
+      clean_exit 0
+    fi
+  fi
+}
+
+check_tmpfile() {
+  if test -h "$tmpfile"; then
+    rm "$tmpfile" || clean_exit 1
+  fi
+}
 
 # command line
 while [ "$#" -gt 0 ]; do
@@ -763,12 +803,11 @@
 if [ "$runmode" = "bugreport" ]; then
   do_log=true
   logfile=/tmp/xine-check.log
+  check_logfile;
   echo logging to ${logfile}...
   echo >$logfile
 fi
 
-
-
 ## actual checks start here:
 
 case `id` in
@@ -1173,16 +1212,6 @@
   clean_exit 0    
 fi
 
-if test -f "$bugreport"; then
-  echo "Hmmm, I already found a bug report in ${bugreport}."
-  if yesno "Do you want me to overwrite that file?"; then
-    rm "$bugreport"
-  else
-    echo "Okay, aborting on your request."
-    clean_exit 0
-  fi
-fi
-  
 echo
 echo
 if yesno "Could you solve your xine problems using the previous hints?"; then
@@ -1190,6 +1219,8 @@
   clean_exit
 fi
 
+check_bugreport;
+
 echo
 echo "What kind of trouble does xine cause for you?"
 echo