[gimp] Syncing TinyScheme with the 1.42 version in the SourceForge repository.



commit e0b6a9cab2870e39255b0efd089e2137fff6dd63
Author: Kevin Cozens <kevin ve3syb ca>
Date:   Sun Aug 2 15:10:55 2020 -0400

    Syncing TinyScheme with the 1.42 version in the SourceForge repository.
    
    This picks up changes applied in SVN revisions 100, 103, 106, and 113.
    The TinyScheme version number has been updated.

 plug-ins/script-fu/tinyscheme/CHANGES  | 19 +++++++++++++++++--
 plug-ins/script-fu/tinyscheme/init.scm |  4 ++--
 plug-ins/script-fu/tinyscheme/scheme.c | 11 ++++++++---
 3 files changed, 27 insertions(+), 7 deletions(-)
---
diff --git a/plug-ins/script-fu/tinyscheme/CHANGES b/plug-ins/script-fu/tinyscheme/CHANGES
index 05a6b7349f..22657f5a22 100644
--- a/plug-ins/script-fu/tinyscheme/CHANGES
+++ b/plug-ins/script-fu/tinyscheme/CHANGES
@@ -1,6 +1,21 @@
 Change Log
 ----------
 
+Version 1.42
+    Other changes:
+        - Fixed segfault crash caused by invalid syntax to cond  (PG)
+        - Fixed a bug in the close-port routine in init.scm
+        - Fixed possible crash loading file due to uninitialized variable  (MP)
+        - Don't use snprintf() in atom2str to return some fixed strings  (KC/MP)
+        - Added "tinyscheme" to the features list  (JaW)
+        - Added Sconstruct to allow building using scons  (AG)
+        - Fixed function prototype for scheme_init_new  (JuW)
+        - Make various limits configurable  (JuW)
+
+    Contributors:
+        Kevin Cozens, Mauro Persano, Pedro Gimeno, James Woodcock, Atanu Ghosh,
+        and Justus Winter.
+
 Version 1.41
     Bugs fixed:
         #3020389 - Added makefile section for Mac OS X  (SL)
@@ -9,7 +24,7 @@ Version 1.41
         #3394882 - Added missing #if in opdefines.h around get and put  (DC)
         #3395547 - Fix for the modulo procedure  (DC)
         #3400290 - Optimized append to make it an O(n) operation  (DC)
-        #3493926 - Corrected flag used when building shared files on OSX (J)
+        #3493926 - Corrected flag used when building shared files on OSX  (J)
 
     R5RS related changes:
         #2866196 - Parser does not handle delimiters correctly
@@ -30,7 +45,7 @@ Version 1.41
 
     Contributors:
         Kevin Cozens, Gordon McNutt, Doug Currie, Sean Long, Tim Cas, Joey,
-        and Richard Copley, and CMarinier.
+        Richard Copley, and CMarinier.
 
 Version 1.40
     Bugs fixed:
diff --git a/plug-ins/script-fu/tinyscheme/init.scm b/plug-ins/script-fu/tinyscheme/init.scm
index 223e42194f..57ae079864 100644
--- a/plug-ins/script-fu/tinyscheme/init.scm
+++ b/plug-ins/script-fu/tinyscheme/init.scm
@@ -606,7 +606,7 @@
 
 (define (close-port p)
      (cond
-          ((input-output-port? p) (close-input-port (close-output-port p)))
+          ((input-output-port? p) (close-input-port p) (close-output-port p))
           ((input-port? p) (close-input-port p))
           ((output-port? p) (close-output-port p))
           (else (throw "Not a port" p))))
@@ -681,7 +681,7 @@
 ;; SRFI-0
 ;; COND-EXPAND
 ;; Implemented as a macro
-(define *features* '(srfi-0))
+(define *features* '(srfi-0 tinyscheme))
 
 (define-macro (cond-expand . cond-action-list)
   (cond-expand-runtime cond-action-list))
diff --git a/plug-ins/script-fu/tinyscheme/scheme.c b/plug-ins/script-fu/tinyscheme/scheme.c
index ff73801738..8b242d5d6d 100644
--- a/plug-ins/script-fu/tinyscheme/scheme.c
+++ b/plug-ins/script-fu/tinyscheme/scheme.c
@@ -1,4 +1,4 @@
-/* T I N Y S C H E M E    1 . 4 1
+/* T I N Y S C H E M E    1 . 4 2
  *   Dimitrios Souflis (dsouflis acm org)
  *   Based on MiniScheme (original credits follow)
  * (MINISCM)               coded by Atsushi Moriwaki (11/5/1989)
@@ -97,7 +97,7 @@ ts_output_string (TsOutputType  type,
  *  Basic memory allocation units
  */
 
-#define banner "TinyScheme 1.41 (with UTF-8 support)"
+#define banner "TinyScheme 1.42 (with UTF-8 support)"
 
 #include <string.h>
 #include <stdlib.h>
@@ -3143,7 +3143,7 @@ static pointer opexe_1(scheme *sc, enum scheme_opcodes op) {
                if(!sc->code) {
                     Error_0(sc,"syntax error in cond");
                }
-               if(car(sc->code)==sc->FEED_TO) {
+               if(!sc->code || car(sc->code)==sc->FEED_TO) {
                     if(!is_pair(cdr(sc->code))) {
                          Error_0(sc,"syntax error in cond");
                     }
@@ -5102,6 +5102,11 @@ void scheme_load_file(scheme *sc, FILE *fin)
 { scheme_load_named_file(sc,fin,0); }
 
 void scheme_load_named_file(scheme *sc, FILE *fin, const char *filename) {
+  if (fin == NULL)
+  {
+    fprintf(stderr,"File pointer can not be NULL when loading a file\n");
+    return;
+  }
   dump_stack_reset(sc);
   sc->envir = sc->global_env;
   sc->file_i=0;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]