From 3e5b8f1e97b748b3f3c5d91df0686bb4c2f88f2c Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Sat, 5 Oct 2013 13:17:51 -0700 Subject: [PATCH 01/12] Bump version to 2.1.0 --- fish.xcodeproj/project.pbxproj | 6 +++--- osx/config.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/fish.xcodeproj/project.pbxproj b/fish.xcodeproj/project.pbxproj index d1b78d8df..9f1ad217b 100644 --- a/fish.xcodeproj/project.pbxproj +++ b/fish.xcodeproj/project.pbxproj @@ -1190,7 +1190,7 @@ "DATADIR=L\\\"/usr/local/share\\\"", "SYSCONFDIR=L\\\"/usr/local/etc\\\"", "BINDIR=L\\\"/usr/local/bin\\\"", - "FISH_BUILD_VERSION=\\\"2.0.0\\\"", + "FISH_BUILD_VERSION=\\\"2.1.0\\\"", ); GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; @@ -1342,7 +1342,7 @@ "DATADIR=L\\\"/usr/local/share\\\"", "SYSCONFDIR=L\\\"/usr/local/etc\\\"", "BINDIR=L\\\"/usr/local/bin\\\"", - "FISH_BUILD_VERSION=\\\"2.0.0\\\"", + "FISH_BUILD_VERSION=\\\"2.1.0\\\"", ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -1370,7 +1370,7 @@ "DATADIR=L\\\"/usr/local/share\\\"", "SYSCONFDIR=L\\\"/usr/local/etc\\\"", "BINDIR=L\\\"/usr/local/bin\\\"", - "FISH_BUILD_VERSION=\\\"2.0.0\\\"", + "FISH_BUILD_VERSION=\\\"2.1.0\\\"", ); GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; diff --git a/osx/config.h b/osx/config.h index 9872a2e12..4968a78b2 100644 --- a/osx/config.h +++ b/osx/config.h @@ -183,7 +183,7 @@ #define PACKAGE_NAME "fish" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "fish 2.0.0" +#define PACKAGE_STRING "fish 2.1.0" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "fish" @@ -192,7 +192,7 @@ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "2.0.0" +#define PACKAGE_VERSION "2.1.0" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 From 460bfc6853d130dd03133e388fd9a7921cec35e5 Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Sat, 5 Oct 2013 17:06:22 -0700 Subject: [PATCH 02/12] Update OS X make_pkg script to also produce fish.app --- build_tools/make_pkg.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/build_tools/make_pkg.sh b/build_tools/make_pkg.sh index 2fb452eac..1b041bdcd 100755 --- a/build_tools/make_pkg.sh +++ b/build_tools/make_pkg.sh @@ -21,3 +21,10 @@ xcodebuild install -scheme install_tree -configuration Release DSTROOT=/tmp/fish pkgbuild --scripts build_tools/osx_package_scripts --root /tmp/fish_pkg/root/ --identifier 'com.ridiculousfish.fish-shell-pkg' --version "$VERSION" /tmp/fish_pkg/intermediates/fish.pkg productbuild --package-path /tmp/fish_pkg/intermediates --distribution build_tools/osx_distribution.xml --resources build_tools/osx_package_resources/ ~/fish_built/fish.pkg + + +# Make the app +xcodebuild -scheme fish.app -configuration Release DSTROOT=/tmp/fish_app/ +rm -f ~/fish_built/fish.app.zip +cd DerivedData/fish/Build/Products/Release/ +zip -r ~/fish_built/fish.app.zip fish.app From 8edb53e9025e2514066905fd37aa3e47db9f3e87 Mon Sep 17 00:00:00 2001 From: Konrad Borowski Date: Sun, 6 Oct 2013 14:16:15 +0200 Subject: [PATCH 03/12] Document appending `/` feature. --- doc_src/cd.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc_src/cd.txt b/doc_src/cd.txt index c1a5875a4..a1da087a3 100644 --- a/doc_src/cd.txt +++ b/doc_src/cd.txt @@ -14,7 +14,8 @@ If \c DIRECTORY is a relative path, the paths found in the path. Note that the shell will attempt to change directory without requiring \c cd -if the name of a directory is provided (starting with '.', '/' or '~'). +if the name of a directory is provided (starting with '.', '/' or '~', or ending +with '/'). \subsection cd-example Examples From 97e731e05cd696b8b286899f38239d68c67ef181 Mon Sep 17 00:00:00 2001 From: Konrad Borowski Date: Wed, 9 Oct 2013 16:39:24 +0200 Subject: [PATCH 04/12] Escape characters in function names. Fixes #1031. --- builtin.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/builtin.cpp b/builtin.cpp index 57a5708cc..f1e73c0af 100644 --- a/builtin.cpp +++ b/builtin.cpp @@ -1115,7 +1115,7 @@ static void functions_def(const wcstring &name, wcstring &out) bool defer_function_name = (name.at(0) == L'-'); if (! defer_function_name) { - out.append(name); + out.append(escape_string(name, true)); } if (! desc.empty()) @@ -1189,7 +1189,7 @@ static void functions_def(const wcstring &name, wcstring &out) if (defer_function_name) { out.append(L" -- "); - out.append(name); + out.append(escape_string(name, true)); } /* This forced tab is sort of crummy - not all functions start with a tab */ From 1349d129c51e0c698645c3806601a7c9ebfcef95 Mon Sep 17 00:00:00 2001 From: Konrad Borowski Date: Sat, 12 Oct 2013 21:55:11 +0200 Subject: [PATCH 05/12] Fix #213. You can now remove autoloaded functions. Oddly enough, the code is here, but is internal function. --- builtin.cpp | 2 +- function.cpp | 5 +---- function.h | 3 +++ 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/builtin.cpp b/builtin.cpp index f1e73c0af..379d52907 100644 --- a/builtin.cpp +++ b/builtin.cpp @@ -1339,7 +1339,7 @@ static int builtin_functions(parser_t &parser, wchar_t **argv) { int i; for (i=woptind; i 0); diff --git a/function.h b/function.h index 2f8dfc36c..e2896f18e 100644 --- a/function.h +++ b/function.h @@ -95,6 +95,9 @@ void function_init(); /** Add a function. */ void function_add(const function_data_t &data, const parser_t &parser); +/** Removes a function from our internal table, returning true if it was found and false if not */ +bool function_remove_ignore_autoload(const wcstring &name); + /** Remove the function with the specified name. */ From 4980959fcea76cf42170836f5c8a0657487cac90 Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Tue, 15 Oct 2013 12:45:33 -0700 Subject: [PATCH 06/12] Fix to enable momentum scrolling on iOS in new documentation --- user_doc.head.html | 1 + 1 file changed, 1 insertion(+) diff --git a/user_doc.head.html b/user_doc.head.html index 958a96910..eae673f5f 100644 --- a/user_doc.head.html +++ b/user_doc.head.html @@ -19,6 +19,7 @@ body top: 36px; bottom: 0; overflow-y: scroll; + -webkit-overflow-scrolling: touch; /* necessary for momentum scrolling */ } .fish_left_bar From 3c5d5b344ee945b99e4bb16a44af6f293601813d Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Wed, 16 Oct 2013 01:02:15 -0700 Subject: [PATCH 07/12] Fix for buffer overflows identified by libgmalloc --- fallback.cpp | 22 ++++++++++++++-------- parse_util.cpp | 6 ++++-- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/fallback.cpp b/fallback.cpp index 7e215bbe7..5e4b3e1b2 100644 --- a/fallback.cpp +++ b/fallback.cpp @@ -1503,14 +1503,20 @@ static int mk_wcwidth(wchar_t ucs) static int mk_wcswidth(const wchar_t *pwcs, size_t n) { - int w, width = 0; - - for (; *pwcs && n-- > 0; pwcs++) - if ((w = mk_wcwidth(*pwcs)) < 0) - return -1; - else - width += w; - + int width = 0; + for (size_t i=0; i < n; i++) + { + if (pwcs[i] == L'\0') + break; + + int w = mk_wcwidth(pwcs[i]); + if (w < 0) + { + width = -1; + break; + } + width += w; + } return width; } diff --git a/parse_util.cpp b/parse_util.cpp index 2f95a3e25..5d8a1b1d0 100644 --- a/parse_util.cpp +++ b/parse_util.cpp @@ -260,8 +260,7 @@ void parse_util_cmdsubst_extent(const wchar_t *buff, size_t cursor_pos, const wc /* No subshell found, all done */ break; } - - /* Intrepret NULL to mean the end */ + /* Interpret NULL to mean the end */ if (end == NULL) { end = const_cast(buff) + bufflen; @@ -273,6 +272,9 @@ void parse_util_cmdsubst_extent(const wchar_t *buff, size_t cursor_pos, const wc begin++; ap = begin; bp = end; + /* pos is where to begin looking for the next one. But if we reached the end there's no next one. */ + if (begin >= end) + break; pos = begin + 1; } else if (begin >= cursor) From 9cb95274a6b38e5d46d7a7c256bd1e28487fb24e Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Sat, 5 Oct 2013 13:17:51 -0700 Subject: [PATCH 08/12] Bump version to 2.1.0 --- fish.xcodeproj/project.pbxproj | 6 +++--- osx/config.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/fish.xcodeproj/project.pbxproj b/fish.xcodeproj/project.pbxproj index d1b78d8df..e3815f5a5 100644 --- a/fish.xcodeproj/project.pbxproj +++ b/fish.xcodeproj/project.pbxproj @@ -1190,7 +1190,7 @@ "DATADIR=L\\\"/usr/local/share\\\"", "SYSCONFDIR=L\\\"/usr/local/etc\\\"", "BINDIR=L\\\"/usr/local/bin\\\"", - "FISH_BUILD_VERSION=\\\"2.0.0\\\"", + "FISH_BUILD_VERSION=\\\"2.1.0\\\"", ); GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; @@ -1342,7 +1342,7 @@ "DATADIR=L\\\"/usr/local/share\\\"", "SYSCONFDIR=L\\\"/usr/local/etc\\\"", "BINDIR=L\\\"/usr/local/bin\\\"", - "FISH_BUILD_VERSION=\\\"2.0.0\\\"", + "FISH_BUILD_VERSION=\\\"2.1.0\\\"", ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -1370,7 +1370,7 @@ "DATADIR=L\\\"/usr/local/share\\\"", "SYSCONFDIR=L\\\"/usr/local/etc\\\"", "BINDIR=L\\\"/usr/local/bin\\\"", - "FISH_BUILD_VERSION=\\\"2.0.0\\\"", + "FISH_BUILD_VERSION=\\\"2.1.0\\\"", ); GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; diff --git a/osx/config.h b/osx/config.h index 9872a2e12..4968a78b2 100644 --- a/osx/config.h +++ b/osx/config.h @@ -183,7 +183,7 @@ #define PACKAGE_NAME "fish" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "fish 2.0.0" +#define PACKAGE_STRING "fish 2.1.0" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "fish" @@ -192,7 +192,7 @@ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "2.0.0" +#define PACKAGE_VERSION "2.1.0" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 From 7d95768a924a8c02ded610781c0f05cb5f72cfca Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Sat, 5 Oct 2013 17:06:22 -0700 Subject: [PATCH 09/12] Update OS X make_pkg script to also produce fish.app --- build_tools/make_pkg.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/build_tools/make_pkg.sh b/build_tools/make_pkg.sh index 2fb452eac..1b041bdcd 100755 --- a/build_tools/make_pkg.sh +++ b/build_tools/make_pkg.sh @@ -21,3 +21,10 @@ xcodebuild install -scheme install_tree -configuration Release DSTROOT=/tmp/fish pkgbuild --scripts build_tools/osx_package_scripts --root /tmp/fish_pkg/root/ --identifier 'com.ridiculousfish.fish-shell-pkg' --version "$VERSION" /tmp/fish_pkg/intermediates/fish.pkg productbuild --package-path /tmp/fish_pkg/intermediates --distribution build_tools/osx_distribution.xml --resources build_tools/osx_package_resources/ ~/fish_built/fish.pkg + + +# Make the app +xcodebuild -scheme fish.app -configuration Release DSTROOT=/tmp/fish_app/ +rm -f ~/fish_built/fish.app.zip +cd DerivedData/fish/Build/Products/Release/ +zip -r ~/fish_built/fish.app.zip fish.app From 1feec5a96c02fb59edbbbdfc6b355d33dc8f1900 Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Tue, 15 Oct 2013 12:45:33 -0700 Subject: [PATCH 10/12] Fix to enable momentum scrolling on iOS in new documentation --- user_doc.head.html | 1 + 1 file changed, 1 insertion(+) diff --git a/user_doc.head.html b/user_doc.head.html index 958a96910..eae673f5f 100644 --- a/user_doc.head.html +++ b/user_doc.head.html @@ -19,6 +19,7 @@ body top: 36px; bottom: 0; overflow-y: scroll; + -webkit-overflow-scrolling: touch; /* necessary for momentum scrolling */ } .fish_left_bar From 838e784c5f912193e1b224dd34ddee9e6ec7f9f1 Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Wed, 16 Oct 2013 01:02:15 -0700 Subject: [PATCH 11/12] Fix for buffer overflows identified by libgmalloc --- fallback.cpp | 20 +++++++++++++------- parse_util.cpp | 6 ++++-- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/fallback.cpp b/fallback.cpp index 7e215bbe7..f469f257a 100644 --- a/fallback.cpp +++ b/fallback.cpp @@ -1503,14 +1503,20 @@ static int mk_wcwidth(wchar_t ucs) static int mk_wcswidth(const wchar_t *pwcs, size_t n) { - int w, width = 0; - - for (; *pwcs && n-- > 0; pwcs++) - if ((w = mk_wcwidth(*pwcs)) < 0) - return -1; - else - width += w; + int width = 0; + for (size_t i=0; i < n; i++) + { + if (pwcs[i] == L'\0') + break; + int w = mk_wcwidth(pwcs[i]); + if (w < 0) + { + width = -1; + break; + } + width += w; + } return width; } diff --git a/parse_util.cpp b/parse_util.cpp index 2f95a3e25..5d8a1b1d0 100644 --- a/parse_util.cpp +++ b/parse_util.cpp @@ -260,8 +260,7 @@ void parse_util_cmdsubst_extent(const wchar_t *buff, size_t cursor_pos, const wc /* No subshell found, all done */ break; } - - /* Intrepret NULL to mean the end */ + /* Interpret NULL to mean the end */ if (end == NULL) { end = const_cast(buff) + bufflen; @@ -273,6 +272,9 @@ void parse_util_cmdsubst_extent(const wchar_t *buff, size_t cursor_pos, const wc begin++; ap = begin; bp = end; + /* pos is where to begin looking for the next one. But if we reached the end there's no next one. */ + if (begin >= end) + break; pos = begin + 1; } else if (begin >= cursor) From ef18d6f70cf33c44c5dbf03f96fa4ed194957cae Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Wed, 16 Oct 2013 01:13:57 -0700 Subject: [PATCH 12/12] Revert a series of accidentally rebased commits --- build_tools/make_pkg.sh | 7 ------- fallback.cpp | 20 +++++++------------- fish.xcodeproj/project.pbxproj | 6 +++--- osx/config.h | 4 ++-- parse_util.cpp | 6 ++---- user_doc.head.html | 1 - 6 files changed, 14 insertions(+), 30 deletions(-) diff --git a/build_tools/make_pkg.sh b/build_tools/make_pkg.sh index 1b041bdcd..2fb452eac 100755 --- a/build_tools/make_pkg.sh +++ b/build_tools/make_pkg.sh @@ -21,10 +21,3 @@ xcodebuild install -scheme install_tree -configuration Release DSTROOT=/tmp/fish pkgbuild --scripts build_tools/osx_package_scripts --root /tmp/fish_pkg/root/ --identifier 'com.ridiculousfish.fish-shell-pkg' --version "$VERSION" /tmp/fish_pkg/intermediates/fish.pkg productbuild --package-path /tmp/fish_pkg/intermediates --distribution build_tools/osx_distribution.xml --resources build_tools/osx_package_resources/ ~/fish_built/fish.pkg - - -# Make the app -xcodebuild -scheme fish.app -configuration Release DSTROOT=/tmp/fish_app/ -rm -f ~/fish_built/fish.app.zip -cd DerivedData/fish/Build/Products/Release/ -zip -r ~/fish_built/fish.app.zip fish.app diff --git a/fallback.cpp b/fallback.cpp index f469f257a..7e215bbe7 100644 --- a/fallback.cpp +++ b/fallback.cpp @@ -1503,20 +1503,14 @@ static int mk_wcwidth(wchar_t ucs) static int mk_wcswidth(const wchar_t *pwcs, size_t n) { - int width = 0; - for (size_t i=0; i < n; i++) - { - if (pwcs[i] == L'\0') - break; + int w, width = 0; + + for (; *pwcs && n-- > 0; pwcs++) + if ((w = mk_wcwidth(*pwcs)) < 0) + return -1; + else + width += w; - int w = mk_wcwidth(pwcs[i]); - if (w < 0) - { - width = -1; - break; - } - width += w; - } return width; } diff --git a/fish.xcodeproj/project.pbxproj b/fish.xcodeproj/project.pbxproj index e3815f5a5..d1b78d8df 100644 --- a/fish.xcodeproj/project.pbxproj +++ b/fish.xcodeproj/project.pbxproj @@ -1190,7 +1190,7 @@ "DATADIR=L\\\"/usr/local/share\\\"", "SYSCONFDIR=L\\\"/usr/local/etc\\\"", "BINDIR=L\\\"/usr/local/bin\\\"", - "FISH_BUILD_VERSION=\\\"2.1.0\\\"", + "FISH_BUILD_VERSION=\\\"2.0.0\\\"", ); GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; @@ -1342,7 +1342,7 @@ "DATADIR=L\\\"/usr/local/share\\\"", "SYSCONFDIR=L\\\"/usr/local/etc\\\"", "BINDIR=L\\\"/usr/local/bin\\\"", - "FISH_BUILD_VERSION=\\\"2.1.0\\\"", + "FISH_BUILD_VERSION=\\\"2.0.0\\\"", ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -1370,7 +1370,7 @@ "DATADIR=L\\\"/usr/local/share\\\"", "SYSCONFDIR=L\\\"/usr/local/etc\\\"", "BINDIR=L\\\"/usr/local/bin\\\"", - "FISH_BUILD_VERSION=\\\"2.1.0\\\"", + "FISH_BUILD_VERSION=\\\"2.0.0\\\"", ); GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; diff --git a/osx/config.h b/osx/config.h index 4968a78b2..9872a2e12 100644 --- a/osx/config.h +++ b/osx/config.h @@ -183,7 +183,7 @@ #define PACKAGE_NAME "fish" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "fish 2.1.0" +#define PACKAGE_STRING "fish 2.0.0" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "fish" @@ -192,7 +192,7 @@ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "2.1.0" +#define PACKAGE_VERSION "2.0.0" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 diff --git a/parse_util.cpp b/parse_util.cpp index 5d8a1b1d0..2f95a3e25 100644 --- a/parse_util.cpp +++ b/parse_util.cpp @@ -260,7 +260,8 @@ void parse_util_cmdsubst_extent(const wchar_t *buff, size_t cursor_pos, const wc /* No subshell found, all done */ break; } - /* Interpret NULL to mean the end */ + + /* Intrepret NULL to mean the end */ if (end == NULL) { end = const_cast(buff) + bufflen; @@ -272,9 +273,6 @@ void parse_util_cmdsubst_extent(const wchar_t *buff, size_t cursor_pos, const wc begin++; ap = begin; bp = end; - /* pos is where to begin looking for the next one. But if we reached the end there's no next one. */ - if (begin >= end) - break; pos = begin + 1; } else if (begin >= cursor) diff --git a/user_doc.head.html b/user_doc.head.html index eae673f5f..958a96910 100644 --- a/user_doc.head.html +++ b/user_doc.head.html @@ -19,7 +19,6 @@ body top: 36px; bottom: 0; overflow-y: scroll; - -webkit-overflow-scrolling: touch; /* necessary for momentum scrolling */ } .fish_left_bar