From 31d11fa63656f2fedda9a691bcf06b720aea7c96 Mon Sep 17 00:00:00 2001 From: ebelcrom Date: Fri, 1 Jun 2018 18:01:19 +0200 Subject: [PATCH] fixed NULL refs, sprip by dh_make now --- deb/shgen-0.1/debian/rules | 2 -- src/Makefile | 3 --- src/debian/changelog | 5 ----- src/debian/compat | 1 - src/debian/control | 13 ----------- src/debian/copyright | 26 ---------------------- src/debian/rules | 26 ---------------------- src/debian/shgen-docs.docs | 2 -- src/debian/source/format | 1 - src/shgen.c | 45 +++++++++++++++----------------------- 10 files changed, 18 insertions(+), 106 deletions(-) delete mode 100644 src/debian/changelog delete mode 100644 src/debian/compat delete mode 100644 src/debian/control delete mode 100644 src/debian/copyright delete mode 100755 src/debian/rules delete mode 100644 src/debian/shgen-docs.docs delete mode 100644 src/debian/source/format diff --git a/deb/shgen-0.1/debian/rules b/deb/shgen-0.1/debian/rules index 4ebc141..efd2d90 100755 --- a/deb/shgen-0.1/debian/rules +++ b/deb/shgen-0.1/debian/rules @@ -22,5 +22,3 @@ # This is example for Cmake (See https://bugs.debian.org/641051 ) #override_dh_auto_configure: # dh_auto_configure -- # -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH) - -override_dh_strip: diff --git a/src/Makefile b/src/Makefile index 9df0f82..c2aafe1 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,5 +1,4 @@ CC ?= gcc -STRIP ?= strip CFLAGS = -O2 -Wall -I/usr/include/cdk LDFLAGS = -lcdk -lncurses @@ -15,8 +14,6 @@ default: $(EXE) $(EXE): %: %.o @echo ' [LD] $<' @$(CC) -o $@ $< $(LDFLAGS) - @echo ' [STRIP] $<' - @$(STRIP) $@ install: $(EXE) @echo ' [INSTALL] $<' diff --git a/src/debian/changelog b/src/debian/changelog deleted file mode 100644 index 6f7f324..0000000 --- a/src/debian/changelog +++ /dev/null @@ -1,5 +0,0 @@ -shgen (0.1-1) lucid; urgency=low - - * Initial release - - -- dragan Thu, 17 May 2018 23:01:27 +0200 diff --git a/src/debian/compat b/src/debian/compat deleted file mode 100644 index ec63514..0000000 --- a/src/debian/compat +++ /dev/null @@ -1 +0,0 @@ -9 diff --git a/src/debian/control b/src/debian/control deleted file mode 100644 index f784bbc..0000000 --- a/src/debian/control +++ /dev/null @@ -1,13 +0,0 @@ -Source: shgen -Section: misc -Priority: optional -Maintainer: dragan -Build-Depends: debhelper (>= 9) -Standards-Version: 3.9.6 -Homepage: https://binomiant.duckdns.org/MpqU9XX8/shgen.git - -Package: shgen -Architecture: any -Depends: libc6 (>= 2.4), libncurses5 (>= 5.0), libcdk5 (>= 5.0) -Description: Console shell script generator. - Ncurses based shell script generator for execution in a console. diff --git a/src/debian/copyright b/src/debian/copyright deleted file mode 100644 index 4c5d211..0000000 --- a/src/debian/copyright +++ /dev/null @@ -1,26 +0,0 @@ -Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: shgen -Source: https://binomiant.duckdns.org/MpqU9XX8/shgen.git - -Files: * -Copyright: 2018 dragan -License: GPL-2+ - -Files: debian/* -Copyright: 2018 dragan -License: GPL-2+ - This package is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - . - This package is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - . - You should have received a copy of the GNU General Public License - along with this program. If not, see - . - On Debian systems, the complete text of the GNU General - Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". diff --git a/src/debian/rules b/src/debian/rules deleted file mode 100755 index 4ebc141..0000000 --- a/src/debian/rules +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/make -f -# See debhelper(7) (uncomment to enable) -# output every command that modifies files on the build system. -#export DH_VERBOSE = 1 - - -# see FEATURE AREAS in dpkg-buildflags(1) -#export DEB_BUILD_MAINT_OPTIONS = hardening=+all - -# see ENVIRONMENT in dpkg-buildflags(1) -# package maintainers to append CFLAGS -#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic -# package maintainers to append LDFLAGS -#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed - - -%: - dh $@ - - -# dh_make generated override targets -# This is example for Cmake (See https://bugs.debian.org/641051 ) -#override_dh_auto_configure: -# dh_auto_configure -- # -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH) - -override_dh_strip: diff --git a/src/debian/shgen-docs.docs b/src/debian/shgen-docs.docs deleted file mode 100644 index 7319041..0000000 --- a/src/debian/shgen-docs.docs +++ /dev/null @@ -1,2 +0,0 @@ -README.source -README.Debian diff --git a/src/debian/source/format b/src/debian/source/format deleted file mode 100644 index 163aaf8..0000000 --- a/src/debian/source/format +++ /dev/null @@ -1 +0,0 @@ -3.0 (quilt) diff --git a/src/shgen.c b/src/shgen.c index ebde091..b10c074 100644 --- a/src/shgen.c +++ b/src/shgen.c @@ -2,17 +2,6 @@ #include #include -/* - * TODO: - * sha bang: /bin/sh|bash - * header: comment, license - * lib.sh: log, error, warning - * BASH_XTRACEFD, debug file - * - check defined - * name and directory - * - parameters... - */ - static int x_size = 0; static int y_size = 0; @@ -49,6 +38,7 @@ static CDKBUTTON* lfile_button; static CDKENTRY* lfile_entry; static CDKBUTTON* generate_button; +static char null[5]; static char* default_opts = " - Abort - Next"; static char* enable_opts = " - Abort - Next" " - Choose"; @@ -85,16 +75,16 @@ static struct s_data char* lfile; } data = { - NULL, + null, FALSE, - NULL, - NULL, - NULL, + null, + null, + null, FALSE, - NULL, - { NULL, NULL, NULL, NULL }, + null, + { null, null, null, null }, FALSE, - NULL + null }; static void create_button(CDKSCREEN* screen); @@ -401,7 +391,7 @@ static int process_common(void) { /* register choice */ int i; - for (i = 0; i < sizeof(data.common); i++) + for (i = 0; i < sizeof(data.common) / sizeof(data.common[0]); i++) { if (common_selection->selections[i]) { @@ -445,7 +435,7 @@ DFILE: if (filename != NULL && strlen(filename) > 0) { /* register choice */ - if (data.dfile != NULL) + if (strcmp(data.dfile, "NULL")) { free(data.dfile); } @@ -647,7 +637,7 @@ LFILE: if (filename != NULL && strlen(filename) > 0) { /* register choice */ - if (data.lfile != NULL) + if (strcmp(data.lfile, "NULL")) { free(data.lfile); } @@ -695,7 +685,7 @@ SCRIPT: if (filename != NULL && strlen(filename) > 0) { /* register choice */ - if (data.script != NULL) + if (strcmp(data.script, "NULL")) { free(data.script); } @@ -759,7 +749,7 @@ static void update_options(char* options) static void write_settings(int view) { - char* shabang = data.shabang; +/* char* shabang = data.shabang; // boolean header; char header[2]; char* description = data.description; @@ -806,13 +796,13 @@ static void write_settings(int view) snprintf(lib, sizeof(lib), "%i", data.lib); if (data.lfile == NULL) lfile = "NULL"; - +*/ if (view) { - char* msg[] = { shabang, header, description, license, script, - debug, dfile, common, lib, lfile }; +/* char* msg[] = { data.shabang, header, data.description, data.license, data.script, + debug, data.dfile, common, lib, data.lfile }; - popupLabel(screen, msg, 10); + popupLabel(screen, msg, 10);*/ } else { @@ -899,6 +889,7 @@ void sig_int(int signo) int main(int argc, char* argv[]) { + snprintf(null, sizeof(null), "%s", "NULL"); dimension_check(); window = initscr(); -- 2.30.2