From 8b236d163236d999b9f18050ac99179563172664 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Sun, 15 Jun 2014 09:44:08 +0000 Subject: [PATCH] Stating license GPLv3+ if header of libreadline >= 6.x is included --- libisoburn/trunk/xorriso/opts_p_z.c | 23 +++++++++++++++++--- libisoburn/trunk/xorriso/text_io.c | 18 +++++++++++++++ libisoburn/trunk/xorriso/text_io.h | 6 ++++- libisoburn/trunk/xorriso/xorriso_timestamp.h | 2 +- 4 files changed, 44 insertions(+), 5 deletions(-) diff --git a/libisoburn/trunk/xorriso/opts_p_z.c b/libisoburn/trunk/xorriso/opts_p_z.c index 5398d354..c86deb27 100644 --- a/libisoburn/trunk/xorriso/opts_p_z.c +++ b/libisoburn/trunk/xorriso/opts_p_z.c @@ -1891,6 +1891,8 @@ int Xorriso_option_use_readline(struct XorrisO *xorriso, char *mode, int flag) /* Option -version */ int Xorriso_option_version(struct XorrisO *xorriso, int flag) { + const char *license_text; + sprintf(xorriso->result_line, "%sxorriso %d.%d.%d%s\n", #ifdef Xorriso_GNU_xorrisO "GNU ", @@ -1918,14 +1920,29 @@ int Xorriso_option_version(struct XorrisO *xorriso, int flag) Xorriso_report_lib_versions(xorriso, 0); #ifdef Xorriso_GNU_xorrisO - sprintf(xorriso->result_line, -"License GPLv3+: GNU GPL version 3 or later .\n"); + + license_text= "License GPLv3+: GNU GPL version 3 or later ."; + sprintf(xorriso->result_line, "%s\n", license_text); Xorriso_result(xorriso, 0); sprintf(xorriso->result_line, "This is free software: you are free to change and redistribute it.\n"); Xorriso_result(xorriso, 0); + #else - sprintf(xorriso->result_line, "Provided under GNU GPL version 2 or later.\n"); + + license_text= "Provided under GNU GPL version 2 or later."; + +#ifdef Xorriso_with_readlinE + { + const char *readline_license; + readline_license= Xorriso__readline_license(0); + if(strcmp(readline_license, "GPLv3+") == 0) + license_text= + "Provided under GNU GPL version 3 or later, due to libreadline license."; + } +#endif /* Xorriso_with_readlinE */ + + sprintf(xorriso->result_line, "%s\n", license_text); Xorriso_result(xorriso, 0); #endif /* ! Xorriso_GNU_xorrisO */ diff --git a/libisoburn/trunk/xorriso/text_io.c b/libisoburn/trunk/xorriso/text_io.c index 1c89cfca..6eed1751 100644 --- a/libisoburn/trunk/xorriso/text_io.c +++ b/libisoburn/trunk/xorriso/text_io.c @@ -121,6 +121,24 @@ int Xorriso__shutdown_editline(int flag) #endif /* Xorriso_with_editlinE */ +#ifdef Xorriso_with_readlinE + +/* http://lists.gnu.org/archive/html/bug-readline/2014-06/msg00005.html */ +const char *Xorriso__readline_license(int flag) +{ +#ifdef RL_VERSION_MAJOR +#if RL_VERSION_MAJOR > 5 + + return("GPLv3+"); + +#endif +#endif + + return("GPLv2+"); +} + +#endif /* Xorriso_with_readlinE */ + #ifdef Xorriso_with_line_editoR char *Xorriso_emul_readline(struct XorrisO *xorriso, int flag) diff --git a/libisoburn/trunk/xorriso/text_io.h b/libisoburn/trunk/xorriso/text_io.h index 48e96a6e..e4a7d820 100644 --- a/libisoburn/trunk/xorriso/text_io.h +++ b/libisoburn/trunk/xorriso/text_io.h @@ -1,7 +1,7 @@ /* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images. - Copyright 2007-2010 Thomas Schmitt, + Copyright 2007-2014 Thomas Schmitt, Provided under GPL version 2 or later. @@ -109,5 +109,9 @@ char *Xorriso_esc_filepath(struct XorrisO *xorriso, int Xorriso__shutdown_editline(int flag); #endif +#ifdef Xorriso_with_readlinE +const char *Xorriso__readline_license(int flag); +#endif + #endif /* ! Xorriso_pvt_textio_includeD */ diff --git a/libisoburn/trunk/xorriso/xorriso_timestamp.h b/libisoburn/trunk/xorriso/xorriso_timestamp.h index d97ccc80..ced05786 100644 --- a/libisoburn/trunk/xorriso/xorriso_timestamp.h +++ b/libisoburn/trunk/xorriso/xorriso_timestamp.h @@ -1 +1 @@ -#define Xorriso_timestamP "2014.06.15.090324" +#define Xorriso_timestamP "2014.06.15.094311"