diff options
-rw-r--r-- | LICENSE-CYG | 4 | ||||
-rw-r--r-- | METALICENSE | 4 | ||||
-rw-r--r-- | txr.c | 36 |
3 files changed, 33 insertions, 11 deletions
diff --git a/LICENSE-CYG b/LICENSE-CYG new file mode 100644 index 00000000..e7b37cd4 --- /dev/null +++ b/LICENSE-CYG @@ -0,0 +1,4 @@ +This build of TXR is linked against the Cygwin library, which is +Copyright (C) 1995-2016 Red Hat Inc. and is distributed and used +with TXR in accordance with the Lesser GNU Public License (LGPL), +Version 3 <https://cygwin.com/COPYING.LIB>. diff --git a/METALICENSE b/METALICENSE index a504cd3c..493a680e 100644 --- a/METALICENSE +++ b/METALICENSE @@ -48,3 +48,7 @@ legally questionable, so the MPI library must be regarded as being copyrighted by Michael J. Fromberger. The above text can be reasonably understood to constitute a license which is compatible with the TXR LICENSE file in the sense that it is at least as permissive. + +TXR is ported to Windows with the help of the Cygwin library. For user +conveninence, a packaged version of TXR includes the CYGWIN.DLL, in accordance +with the terms of Cywgin's license, the GNU Lesser Public License, Version 3. @@ -53,6 +53,9 @@ #include "regex.h" #include "arith.h" #include "sysif.h" +#if HAVE_GLOB +#include "glob.h" +#endif #include "txr.h" const wchli_t *version = wli(TXR_VER); @@ -337,25 +340,36 @@ static int license(void) { int retval = EXIT_SUCCESS; - uw_catch_begin(cons(error_s, nil), esym, eobj); + uw_catch_begin(cons(error_s, nil), esym, eargs); { - val path = sysroot(lit("share/txr/LICENSE")); - val lic = open_file(path, lit("r")); - val line; - - put_char(chr('\n'), std_output); + val iter; +#if HAVE_GLOB + val glob_pattern = sysroot(lit("share/txr/LICENSE*")); + val path_list = glob_wrap(glob_pattern, zero, nil); +#else + val glob_pattern = sysroot(lit("share/txr/LICENSE")); + val path_list = cons(glob_pattern, nil); +#endif - while ((line = get_line(lic))) - put_line(line, std_output); + if (!path_list) + uw_throwf(error_s, lit("Error: pattern ~a didn't match any files."), + glob_pattern, nao); put_char(chr('\n'), std_output); - close_stream(lic, nil); + for (iter = path_list; iter; iter = cdr(iter)) { + val lic = open_file(car(iter), lit("r")); + + put_lines(lazy_stream_cons(lic), std_output); + put_char(chr('\n'), std_output); + } } - uw_catch (esym, eobj) { - format(std_output, lit("~a:\nThis TXR installation might be unlicensed.\n"), eobj, nao); + uw_catch (esym, eargs) { + format(std_output, + lit("~a\nThis TXR installation might be unlicensed.\n"), + car(eargs), nao); retval = EXIT_FAILURE; } |