From: Fredrik Fornwall Date: Sat, 16 Jan 2016 13:51:45 +0000 (-0500) Subject: hexcurse: Backport patch to show help X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/termux-packages/commitdiff_plain/7a9e707f15e51a38424cf78b59f0ed3c7f17a513?ds=inline hexcurse: Backport patch to show help Add patch from unreleased version which shows help if no filename argument is supplied. --- diff --git a/packages/hexcurse/build.sh b/packages/hexcurse/build.sh index 1d7543e7..7a1a1b5f 100644 --- a/packages/hexcurse/build.sh +++ b/packages/hexcurse/build.sh @@ -1,6 +1,7 @@ TERMUX_PKG_HOMEPAGE=https://github.com/LonnyGomes/hexcurse TERMUX_PKG_DESCRIPTION="Console hexeditor" TERMUX_PKG_VERSION=1.60.0 +TERMUX_PKG_BUILD_REVISION=1 TERMUX_PKG_SRCURL=https://github.com/LonnyGomes/hexcurse/archive/v${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_FOLDERNAME=hexcurse-${TERMUX_PKG_VERSION} TERMUX_PKG_DEPENDS="ncurses" diff --git a/packages/hexcurse/hexcurse.c.patch b/packages/hexcurse/hexcurse.c.patch new file mode 100644 index 00000000..f8c2a626 --- /dev/null +++ b/packages/hexcurse/hexcurse.c.patch @@ -0,0 +1,28 @@ +From 37f94f2c1d0a3cc5110b2771e02ed894522d65d3 Mon Sep 17 00:00:00 2001 +From: Lonny Gomes +Date: Wed, 18 Nov 2015 23:57:31 -0500 +Subject: [PATCH] Fixes #23, shows help if no filename argument is supplied + +--- + src/hexcurse.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/src/hexcurse.c b/src/hexcurse.c +index 9a275ee..9342eb5 100644 +--- a/src/hexcurse.c ++++ b/src/hexcurse.c +@@ -217,9 +217,13 @@ off_t parseArgs(int argc, char *argv[]) + fpINfilename = strdup(argv[0]); + } + +- if (fpINfilename && strcmp(fpINfilename, "")) ++ if (fpINfilename == NULL) { ++ print_usage(); ++ exit(-1); ++ } else if (fpINfilename && strcmp(fpINfilename, "")) { + if ((fpIN = fopen(fpINfilename, "r")) == NULL) + exit_err("Could not open file"); ++ } + + return ((fpIN != NULL) ? maxLoc(fpIN):0); /* return file length */ + }