patch-xlHtml_nsxlview 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. $OpenBSD: patch-xlHtml_nsxlview,v 1.1.1.1 2001/07/13 15:16:22 avsm Exp $
  2. --- xlHtml/nsxlview.orig Sun Dec 26 20:39:05 1999
  3. +++ xlHtml/nsxlview Fri Jul 13 12:30:05 2001
  4. @@ -1,4 +1,4 @@
  5. -#!/bin/tcsh
  6. +#!/bin/csh
  7. if ($#argv != 1) then
  8. echo "Usage: $0 file.xls"
  9. @@ -9,12 +9,13 @@ set source = $argv[1]
  10. #Generate a unique html filename (/tmp/scriptname.pidnum.html)
  11. set com = $0
  12. -set tmp = /tmp/$com:t.$$
  13. -set html = $tmp.html
  14. +set tmp = `mktemp -d /tmp/nsxlview.XXXXXXXXXX` || exit 1
  15. +set tmp2 = `mktemp -d $tmp/nsxlview.XXXXXXXXXX` || exit 1
  16. +set html = $tmp2.html
  17. xlHtml -a $source > $html
  18. -if ((!(-s $html)) | ($status)) then
  19. - echo "$0: failed to generate HTML file"
  20. +if ((!(-r $html)) | ($status)) then
  21. + echo "$0"": failed to generate HTML file"
  22. exit 1
  23. endif
  24. @@ -24,6 +25,6 @@ nsopen $html
  25. #I remove the html file for security reasons. If you want to be able
  26. #to click on the "Back" button without getting a "file not found"
  27. #error - comment the next line.
  28. -rm -f $tmp*
  29. +rm -rf $tmp
  30. exit 0