From a5c8e032b7a52778855e9d6af4c3c4709ae851ba Mon Sep 17 00:00:00 2001 From: "zodiac@gmail.com" Date: Fri, 9 Jul 2010 16:10:21 +0000 Subject: [PATCH] Fixed assertion failure, when loading empty style files and using a more modern version of glibc. Fixed incorrect autoconf detection of isnan() support when using glibc and more recent versions of gcc. git-svn-id: https://shellinabox.googlecode.com/svn/trunk@209 0da03de8-d603-11dd-86c2-0f8696b7b6f9 --- config.h | 2 +- configure | 4 ++-- configure.ac | 4 ++-- demo/vt100.js | 2 +- shellinabox/shell_in_a_box.js | 2 +- shellinabox/usercss.c | 4 +++- shellinabox/vt100.js | 2 +- 7 files changed, 11 insertions(+), 9 deletions(-) diff --git a/config.h b/config.h index 31c1dcc..d4dc1d1 100644 --- a/config.h +++ b/config.h @@ -153,7 +153,7 @@ #define STDC_HEADERS 1 /* Most recent revision number in the version control system */ -#define VCS_REVISION "208" +#define VCS_REVISION "209" /* Version number of package */ #define VERSION "2.10" diff --git a/configure b/configure index 47f3cab..f7f45de 100755 --- a/configure +++ b/configure @@ -2328,7 +2328,7 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -VCS_REVISION=208 +VCS_REVISION=209 cat >>confdefs.h <<_ACEOF @@ -10720,7 +10720,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext int main () { -isnan(0.0); +if (isnan(0.0)) return 1; ; return 0; } diff --git a/configure.ac b/configure.ac index 511cc32..0e20240 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ AC_PREREQ(2.57) dnl This is the one location where the authoritative version number is stored AC_INIT(shellinabox, 2.10, markus@shellinabox.com) -VCS_REVISION=208 +VCS_REVISION=209 AC_SUBST(VCS_REVISION) AC_DEFINE_UNQUOTED(VCS_REVISION, "${VCS_REVISION}", [Most recent revision number in the version control system]) @@ -57,7 +57,7 @@ AC_TRY_LINK([#include dnl Not every system has support for isnan() AC_TRY_LINK([#include ], - [isnan(0.0);], + [if (isnan(0.0)) return 1;], [AC_DEFINE(HAVE_ISNAN, 1, Define to 1 if you have support for isnan)]) diff --git a/demo/vt100.js b/demo/vt100.js index 0e83bb6..4976ddb 100644 --- a/demo/vt100.js +++ b/demo/vt100.js @@ -1955,7 +1955,7 @@ VT100.prototype.toggleBell = function() { }; VT100.prototype.about = function() { - alert("VT100 Terminal Emulator " + "2.10 (revision 208)" + + alert("VT100 Terminal Emulator " + "2.10 (revision 209)" + "\nCopyright 2008-2010 by Markus Gutschke\n" + "For more information check http://shellinabox.com"); }; diff --git a/shellinabox/shell_in_a_box.js b/shellinabox/shell_in_a_box.js index ddf5c63..f34d87e 100644 --- a/shellinabox/shell_in_a_box.js +++ b/shellinabox/shell_in_a_box.js @@ -358,7 +358,7 @@ ShellInABox.prototype.extendContextMenu = function(entries, actions) { }; ShellInABox.prototype.about = function() { - alert("Shell In A Box version " + "2.10 (revision 208)" + + alert("Shell In A Box version " + "2.10 (revision 209)" + "\nCopyright 2008-2010 by Markus Gutschke\n" + "For more information check http://shellinabox.com" + (typeof serverSupportsSSL != 'undefined' && serverSupportsSSL ? diff --git a/shellinabox/usercss.c b/shellinabox/usercss.c index 6be9b3e..09da5ee 100644 --- a/shellinabox/usercss.c +++ b/shellinabox/usercss.c @@ -76,7 +76,9 @@ static void readStylesheet(struct UserCSS *userCSS, const char *filename, FILE *fp; check(fp = fdopen(fd, "r")); check(*style = malloc(st.st_size + 1)); - check(fread(*style, st.st_size, 1, fp) == 1); + if (st.st_size > 0) { + check(fread(*style, st.st_size, 1, fp) == 1); + } (*style)[st.st_size] = '\000'; *len = st.st_size; fclose(fp); diff --git a/shellinabox/vt100.js b/shellinabox/vt100.js index 0e83bb6..4976ddb 100644 --- a/shellinabox/vt100.js +++ b/shellinabox/vt100.js @@ -1955,7 +1955,7 @@ VT100.prototype.toggleBell = function() { }; VT100.prototype.about = function() { - alert("VT100 Terminal Emulator " + "2.10 (revision 208)" + + alert("VT100 Terminal Emulator " + "2.10 (revision 209)" + "\nCopyright 2008-2010 by Markus Gutschke\n" + "For more information check http://shellinabox.com"); };