I haven't tested it yet, but I trust Tommi :-)

Ray
-- 
LEADERSHIP  A form of self-preservation exhibited by people with auto-
destructive imaginations in order to ensure that when it comes to the crunch 
it'll be someone else's bones which go crack and not their own.       
- The Hipcrime Vocab by Chad C. Mulligan    


        This patch will make Lsh totally free of SCSH,
        even the (also non-free) guile-scsh library.
        Please submit it upstream.
-- 
Havoc Consulting | unix, linux, perl, mail, www, internet, security consulting
+358 50 5486010  | software development, unix administration, training
# This is a patch for lsh-snapshot-1999-05-11.orig to update it to 
lsh-snapshot-1999-05-11.tv.
# It was generated by makepatch 1.93 (2.0BETA) on Tue Jun  8 15:25:46 1999.
#
# To apply this patch, chdir to source directory lsh-snapshot-1999-05-11.orig and enter
#
#     patch -p1 -N < <this-file>

exit
# End of preamble.

# Patch input follows.
__DATA__
Index: README
####### lsh-snapshot-1999-05-11.tv/ => lsh-snapshot-1999-05-11.tv
*** lsh-snapshot-1999-05-11.tv/README   Tue Apr 27 16:31:36 1999
--- lsh-snapshot-1999-05-11.tv/README   Wed Jun  2 22:23:17 1999
***************
*** 21,30 ****
     make
  
  If you want to hack lsh, you need some more tools: autoconf, automake,
! GNU-make, gcc, gperf (at least version 2.7) and scsh. All but scsh can
! be found at your local GNU mirror site. scsh, Olin Shiver's Scheme
! Shell, can be downloaded from <URL:
! ftp://ftp-swiss.ai.mit.edu/pub/su/scsh/scsh.tar.gz>.
  
  If you have checked out lsh from CVS, things are more complicated. You
  must first generate Makefile.am files from the corresponding
--- 21,28 ----
     make
  
  If you want to hack lsh, you need some more tools: autoconf, automake,
! GNU-make, gcc, gperf (at least version 2.7) and guile. All these can
! be found at your local GNU mirror site.
  
  If you have checked out lsh from CVS, things are more complicated. You
  must first generate Makefile.am files from the corresponding
Index: configure.in
Prereq:  1.13 
####### lsh-snapshot-1999-05-11.tv/ => lsh-snapshot-1999-05-11.tv
*** lsh-snapshot-1999-05-11.tv/configure.in     Tue Apr 27 21:52:36 1999
--- lsh-snapshot-1999-05-11.tv/configure.in     Wed Jun  2 14:22:35 1999
***************
*** 97,103 ****
  AC_PROG_RANLIB
  AM_PROG_CC_STDC
  
! AC_PATH_PROG(SCHEME, scsh,, $PATH)
  AC_PATH_PROG(BASH, bash,, $PATH)
  AC_PATH_PROG(GROFF, groff,, $PATH)
  
--- 97,103 ----
  AC_PROG_RANLIB
  AM_PROG_CC_STDC
  
! AC_PATH_PROG(SCHEME, guile,, $PATH)
  AC_PATH_PROG(BASH, bash,, $PATH)
  AC_PATH_PROG(GROFF, groff,, $PATH)
  
Index: doc/TODO
####### lsh-snapshot-1999-05-11.tv/ => lsh-snapshot-1999-05-11.tv
*** lsh-snapshot-1999-05-11.tv/doc/TODO Tue May 11 21:46:35 1999
--- lsh-snapshot-1999-05-11.tv/doc/TODO Wed Jun  2 11:48:04 1999
***************
*** 138,150 ****
  regular lsh distribution, and make it available separately (this approach is
  taken with GnuPG).
  
- scsh is not free software. Olin Shivers (one of the scsh copyright owners)
- has indicated he is willing to free it, but currently he has no time to
- handle the paperwork. We need scsh to be freed, or we need to rewrite the
- Scheme scripts so that they are as portable between Scheme implementations
- as possible, or switch to a free Scheme implementation, like Guile. This is
- not urgent however.
- 
  
  CONTROL
  
--- 138,143 ----
Index: src/Makefile.am.in
####### lsh-snapshot-1999-05-11.tv/ => lsh-snapshot-1999-05-11.tv
*** lsh-snapshot-1999-05-11.tv/src/Makefile.am.in       Mon May 10 23:31:25 1999
--- lsh-snapshot-1999-05-11.tv/src/Makefile.am.in       Wed Jun  2 14:26:58 1999
***************
*** 151,158 ****
  # This is GNU make specific
  
  %.x: % $(srcdir)/make_class $(srcdir)/compiler.scm
!       $(SCHEME) -e main -l $(srcdir)/compiler.scm \
!                 -s $(srcdir)/make_class <$< >$@T
        test -s $@T && mv -f $@T $@
  
  include $(top_srcdir)/misc/ctags.mk
--- 151,158 ----
  # This is GNU make specific
  
  %.x: % $(srcdir)/make_class $(srcdir)/compiler.scm
!       $(SCHEME) -l $(srcdir)/compiler.scm -l $(srcdir)/make_class \
!               -c '(main)'  <$< >$@T
        test -s $@T && mv -f $@T $@
  
  include $(top_srcdir)/misc/ctags.mk
Index: src/compiler.scm
####### lsh-snapshot-1999-05-11.tv/ => lsh-snapshot-1999-05-11.tv
*** lsh-snapshot-1999-05-11.tv/src/compiler.scm Tue Apr  6 22:11:23 1999
--- lsh-snapshot-1999-05-11.tv/src/compiler.scm Tue Jun  8 09:30:27 1999
***************
*** 1,5 ****
--- 1,7 ----
  ;; FIXME: Turn this into a scheme48 module
  
+ (use-modules (ice-9 slib))
+ (require 'macro-by-example)
  (define-syntax let-and
    (syntax-rules '()
                ((let-and (expr) clause clauses ...)
Index: src/make_char_classes
####### lsh-snapshot-1999-05-11.tv/ => lsh-snapshot-1999-05-11.tv
*** lsh-snapshot-1999-05-11.tv/src/make_char_classes    Fri Jan  1 23:49:34 1999
--- lsh-snapshot-1999-05-11.tv/src/make_char_classes    Tue Jun  8 15:22:03 1999
***************
*** 1,4 ****
! #! /usr/local/bin/scsh \
  -e main -s
  !#
  
--- 1,4 ----
! #! /usr/bin/guile \
  -e main -s
  !#
  
***************
*** 8,23 ****
  ;; a partition table index by character, and masks corresponding to
  ;; the input classes.
  
  ;; Misc functions
  (define (my-error s . args)
    (error (apply format #f s args)))
  
  (define (debug s . args)
!   ; (apply format (error-output-port) s args))
    #f)
  
  (define (werror s . args)
!   (apply format (error-output-port) s args))
  
  (define (filter p l)
    (cond ((null? l) l)
--- 8,81 ----
  ;; a partition table index by character, and masks corresponding to
  ;; the input classes.
  
+ (use-modules (ice-9 slib))
+ (require 'macro-by-example)
+ (require 'format)
+ 
+ (define (is-in-charset? set n)
+   (not (zero? (char->integer (string-ref set n)))))
+ 
+ (define (char-set-members char-set)
+   (define (helper n)
+     (cond ((>= n 256) '())
+           ((is-in-charset? char-set n) (cons (integer->char n)
+                                              (helper (1+ n))))
+           (else (helper (1+ n)))))
+   (helper 0))
+ 
+ (define (ascii-range->char-set lower upper)
+   (do ((result (make-string 256 (integer->char 0)))
+        (i lower (+ i 1)))
+       ((= i upper) result)
+     (string-set! result i (integer->char 1))))
+ 
+ (define (chars->char-set chars)
+   (do ((result (make-string 256 (integer->char 0)))
+        (chars chars (cdr chars)))
+       ((null? chars) result)
+     (string-set! result (char->integer (car chars)) (integer->char 1))))
+ 
+ (define (string->char-set str)
+   (chars->char-set (string->list str)))
+ 
+ (define (char-set-intersection set1 set2)
+   (do ((result (make-string 256))
+        (i 0 (+ i 1)))
+       ((= i 255) result)
+     (string-set! result i 
+                  (if (and (is-in-charset? set1 i) (is-in-charset? set2 i))
+                      (integer->char 1)
+                      (integer->char 0)))))
+ 
+ (define (char-set-union set1 set2)
+   (do ((result (make-string 256))
+        (i 0 (+ i 1)))
+       ((= i 255) result)
+     (string-set! result i 
+                  (if (or (is-in-charset? set1 i) (is-in-charset? set2 i))
+                      (integer->char 1)
+                      (integer->char 0)))))
+ 
+ (define (char-set-difference set1 set2)
+   (do ((result (make-string 256))
+        (i 0 (+ i 1)))
+       ((= i 255) result)
+     (string-set! result i 
+                  (if (and (is-in-charset? set1 i) 
+                           (not (is-in-charset? set2 i)))
+                      (integer->char 1)
+                      (integer->char 0)))))
+ 
  ;; Misc functions
  (define (my-error s . args)
    (error (apply format #f s args)))
  
  (define (debug s . args)
!   ; (apply format (current-error-port) s args))
    #f)
  
  (define (werror s . args)
!   (apply format (current-error-port) s args))
  
  (define (filter p l)
    (cond ((null? l) l)
***************
*** 67,76 ****
  (define (input->char-set o names)
    (define (->ascii x)
      (cond ((integer? x) x)
!         ((char? x) (char->ascii x))
          (else #f)))
    (define (->char x)
!     (cond ((integer? x) (ascii->char x))
          ((char? x) x)
          (else #f)))
    (define (integer-or-char? x)
--- 125,134 ----
  (define (input->char-set o names)
    (define (->ascii x)
      (cond ((integer? x) x)
!         ((char? x) (char->integer x))
          (else #f)))
    (define (->char x)
!     (cond ((integer? x) (integer->char x))
          ((char? x) x)
          (else #f)))
    (define (integer-or-char? x)
***************
*** 241,247 ****
      (for-each (lambda (leaf)
                (let ((flag (tree/index leaf)))
                  (for-each (lambda (c)
!                             (vector-set! table (char->ascii c) flag))
                            (char-set-members (tree/set leaf)))))
              leafs)
      table))
--- 299,305 ----
      (for-each (lambda (leaf)
                (let ((flag (tree/index leaf)))
                  (for-each (lambda (c)
!                             (vector-set! table (char->integer c) flag))
                            (char-set-members (tree/set leaf)))))
              leafs)
      table))
***************
*** 288,295 ****
         (roots (map cdr classes)))
      (partition! roots)
  
!     (write-string "#ifdef CHAR_CLASSES_TABLE\n")
!     (write-string "int CHAR_CLASSES_TABLE[] =\n")
  
      (let ((leafs (index-leafs! roots)))
        (werror "~s disjunct classes found.\n" (length leafs))
--- 346,353 ----
         (roots (map cdr classes)))
      (partition! roots)
  
!     (display "#ifdef CHAR_CLASSES_TABLE\n")
!     (display "int CHAR_CLASSES_TABLE[] =\n")
  
      (let ((leafs (index-leafs! roots)))
        (werror "~s disjunct classes found.\n" (length leafs))
***************
*** 301,314 ****
                                                 (vector->list row))))
                            (vector->list (vector-split (build-char-table leafs)
                                                        32))))))
!     (write-string "#else /* !CHAR_CLASSES_TABLE */\n")
      (for-each (lambda (class)
                (format #t "#define CHAR_~a (~a)\n"
                        (car class)
                        (implode " | " (map bit->mask (build-flags (cdr class))))))
              classes)
!     (write-string "#define CHAR_other 1\n")
!     (write-string "#endif /* !CHAR_CLASSES_TABLE */\n")))
  
  (define test-2-input
    '((lower . "abcdefghijklmnopqrstuvwxyz")
--- 359,372 ----
                                                 (vector->list row))))
                            (vector->list (vector-split (build-char-table leafs)
                                                        32))))))
!     (display "#else /* !CHAR_CLASSES_TABLE */\n")
      (for-each (lambda (class)
                (format #t "#define CHAR_~a (~a)\n"
                        (car class)
                        (implode " | " (map bit->mask (build-flags (cdr class))))))
              classes)
!     (display "#define CHAR_other 1\n")
!     (display "#endif /* !CHAR_CLASSES_TABLE */\n")))
  
  (define test-2-input
    '((lower . "abcdefghijklmnopqrstuvwxyz")
Index: src/make_class
####### lsh-snapshot-1999-05-11.tv/ => lsh-snapshot-1999-05-11.tv
*** lsh-snapshot-1999-05-11.tv/src/make_class   Fri Apr  2 15:44:06 1999
--- lsh-snapshot-1999-05-11.tv/src/make_class   Tue Jun  8 15:25:31 1999
***************
*** 1,4 ****
! #! /usr/local/bin/scsh \
  -e main -l compiler.scm -s
  !#
  
--- 1,4 ----
! #! /usr/bin/guile \
  -e main -l compiler.scm -s
  !#
  
***************
*** 16,23 ****
  ;; FIXME: Perhaps the files should somehow be fed through the
  ;; preprocessor first?
  
  (define (werror f . args)
!   (display (apply format #f f args) 2))
  
  (define (string-prefix? prefix s)
    (let ((l (string-length prefix)))
--- 16,26 ----
  ;; FIXME: Perhaps the files should somehow be fed through the
  ;; preprocessor first?
  
+ (use-modules (slib))
+ (require 'format)
+ 
  (define (werror f . args)
!   (display (apply format #f f args) (current-error-port)))
  
  (define (string-prefix? prefix s)
    (let ((l (string-length prefix)))


End of Patch.


Reply via email to