Hello community, here is the log from the commit of package multitail for openSUSE:Factory checked in at 2020-09-15 16:31:28 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/multitail (Old) and /work/SRC/openSUSE:Factory/.multitail.new.4249 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "multitail" Tue Sep 15 16:31:28 2020 rev:15 rq:834551 version:6.5.0 Changes: -------- --- /work/SRC/openSUSE:Factory/multitail/multitail.changes 2018-02-07 18:43:03.303570698 +0100 +++ /work/SRC/openSUSE:Factory/.multitail.new.4249/multitail.changes 2020-09-15 16:31:47.510797938 +0200 @@ -1,0 +2,21 @@ +Fri Sep 11 14:58:35 UTC 2020 - Dirk Mueller <dmuel...@suse.com> + +- update to 6.5.0 + * Fix man-page capitalizing + * Let -sn and -sw accept 0 + * Fix for terminal corruption caused by invalid UTF-8 codes + * Clarified usage of -a/-A + * Add support for 256 colors in color scheme files + * Fix missing netinet/in.h include in clipboard.c + * Another format to support common logging pattern from log4j for java processes + * Add a configuration file item to control whether scrollback should default to fullscreen. + * Fix for -Rc + * Fix -q/-Q memory leak + * Allow -CT to apply terminal settings to wildcards + * Color schemes for 1xx, 2xx, 3xx, 4xx, 5xx HTTP codes + * Fix documented grace periods + * Fix spelling and typos in comments in multitail.conf + * Prevent segfault when inverting an inverted search +- remove multitail-6.4.1-gentoo.patch (obsolete) + +------------------------------------------------------------------- Old: ---- multitail-6.4.1-gentoo.patch multitail-6.4.2.tgz New: ---- multitail-6.5.0.tgz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ multitail.spec ++++++ --- /var/tmp/diff_new_pack.nJfwwr/_old 2020-09-15 16:31:49.838800167 +0200 +++ /var/tmp/diff_new_pack.nJfwwr/_new 2020-09-15 16:31:49.842800171 +0200 @@ -18,15 +18,13 @@ Name: multitail -Version: 6.4.2 +Version: 6.5.0 Release: 0 Summary: Tail Multiple Files License: GPL-2.0+ Group: System/X11/Terminals Url: https://www.vanheusden.com/multitail/ Source: https://www.vanheusden.com/multitail/%{name}-%{version}.tgz -# patch from https://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/app-text/multitail/files/ -Patch0: multitail-6.4.1-gentoo.patch Patch3: multitail-fix_missing_proto_do_check_for_mail.patch BuildRequires: ncurses-devel BuildRequires: pkgconfig @@ -49,7 +47,6 @@ %prep %setup -q -%patch0 -p1 %patch3 sed -i 's/\.new//g' Makefile @@ -62,10 +59,12 @@ make %{?_smp_mflags} \ PKG_CONFIG="pkg-config" \ UTF8_SUPPORT=yes \ + PREFIX=%_prefix \ CONFIG_FILE="%{_sysconfdir}/%{name}.conf" %install -%make_install +%make_install PREFIX=%_prefix +mv %{buildroot}/%_prefix/%_sysconfdir %{buildroot}/%_sysconfdir # docs are shipped already rm -fr %{buildroot}%{_datadir}/doc/%{name}-%{version} ++++++ multitail-6.4.2.tgz -> multitail-6.5.0.tgz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/multitail-6.4.2/Makefile new/multitail-6.5.0/Makefile --- old/multitail-6.4.2/Makefile 2015-02-12 09:32:35.000000000 +0100 +++ new/multitail-6.5.0/Makefile 2019-11-07 13:56:23.000000000 +0100 @@ -1,29 +1,49 @@ include version -UTF8_SUPPORT=yes +PLATFORM:=$(shell uname) +CPPFLAGS:=$(shell pkg-config --cflags ncurses) +NCURSES_LIB:=$(shell pkg-config --libs ncurses) +DEBUG:=#XXX -g -D_DEBUG ###-pg -Wpedantic ## -pg #-fprofile-arcs +# pkg-config --libs --cflags ncurses +# -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -lncurses -ltinfo + +UTF8_SUPPORT:=yes DESTDIR= -PREFIX=/usr -CONFIG_FILE=$(DESTDIR)/etc/multitail.conf +PREFIX=/usr/local +CONFIG_FILE=$(DESTDIR)$(PREFIX)/etc/multitail.conf CC?=gcc -DEBUG+=-g -Wall # -D_DEBUG # -pg # -D_DEBUG #-pg -W -pedantic # -pg #-fprofile-arcs +CFLAGS+=-Wall -Wno-unused-parameter -funsigned-char -O3 +CPPFLAGS+=-D$(PLATFORM) -DVERSION=\"$(VERSION)\" $(DEBUG) -DCONFIG_FILE=\"$(CONFIG_FILE)\" -D_FORTIFY_SOURCE=2 + +# build dependency files while compile (*.d) +CPPFLAGS+= -MMD -MP + + +ifeq ($(PLATFORM),Darwin) + LDFLAGS+=-lpanel $(NCURSES_LIB) -lutil -lm +else ifeq ($(UTF8_SUPPORT),yes) -LDFLAGS+=-lpanelw -lncursesw -lutil -lm -CFLAGS+=-funsigned-char -D`uname` -DVERSION=\"$(VERSION)\" -DCONFIG_FILE=\"$(CONFIG_FILE)\" -DUTF8_SUPPORT -D_FORTIFY_SOURCE=2 -O3 + LDFLAGS+=-lpanelw -lncursesw -lutil -lm + CPPFLAGS+=-DUTF8_SUPPORT else -LDFLAGS+=-lpanel -lncurses -lutil -lm -CFLAGS+=-funsigned-char -D`uname` -DVERSION=\"$(VERSION)\" -DCONFIG_FILE=\"$(CONFIG_FILE)\" -D_FORTIFY_SOURCE=2 -O3 + LDFLAGS+=-lpanel -lncurses -lutil -lm +endif endif -OBJS=utils.o mt.o error.o my_pty.o term.o scrollback.o help.o mem.o cv.o selbox.o stripstring.o color.o misc.o ui.o exec.o diff.o config.o cmdline.o globals.o history.o xclip.o +OBJS:=utils.o mt.o error.o my_pty.o term.o scrollback.o help.o mem.o cv.o selbox.o stripstring.o color.o misc.o ui.o exec.o diff.o config.o cmdline.o globals.o history.o clipboard.o +DEPENDS:= $(OBJS:%.o=%.d) + + +.PHONY: all check install uninstall coverity clean distclean package thanks all: multitail multitail: $(OBJS) $(CC) $(OBJS) $(LDFLAGS) -o multitail -multitail_ccmalloc: $(OBJS) - ccmalloc --no-wrapper $(CC) -Wall -W $(OBJS) $(LDFLAGS) -o ccmultitail +ccmultitail: $(OBJS) + ccmalloc --no-wrapper -Wextra $(CC) $(OBJS) $(LDFLAGS) -o ccmultitail install: multitail mkdir -p $(DESTDIR)$(PREFIX)/bin @@ -36,9 +56,9 @@ ### COPIED multitail.conf.new, YOU NEED TO REPLACE THE multitail.conf ### YOURSELF WITH THE NEW FILE # - mkdir -p $(DESTDIR)/etc/multitail/ + mkdir -p $(DESTDIR)$(PREFIX)/etc/multitail/ cp multitail.conf $(CONFIG_FILE).new - cp conversion-scripts/* $(DESTDIR)/etc/multitail/ + cp conversion-scripts/* $(DESTDIR)$(PREFIX)/etc/multitail/ #rm -f $(DESTDIR)$(PREFIX)/share/man/man1/multitail.1.gz #gzip -9 $(DESTDIR)$(PREFIX)/share/man/man1/multitail.1 # @@ -78,11 +98,14 @@ echo echo Oh, blatant plug: http://keetweej.vanheusden.com/wishlist.html +### cppcheck: unusedFunction check can't be used with '-j' option. Disabling unusedFunction check. check: - cppcheck -v --force -j 3 --enable=all --inconclusive -I. . 2> err.txt - # + #XXX TBD to use cppechk --check-config $(CPPFLAGS) -I/usr/include + cppcheck --std=c99 --verbose --force --enable=all --inconclusive --template=gcc \ + '--suppress=variableScope' --xml --xml-version=2 . 2> cppcheck.xml + cppcheck-htmlreport --file=cppcheck.xml --report-dir=cppcheck make clean - scan-build make + -scan-build make coverity: make clean @@ -91,3 +114,12 @@ tar vczf ~/site/coverity/multitail.tgz README cov-int/ putsite -q /home/folkert/.coverity-mt.sh + +distclean: clean + rm -rf cov-int cppcheck cppcheck.xml *.d *~ tags + +# include dependency files for any other rule: +ifneq ($(filter-out clean distclean,$(MAKECMDGOALS)),) +-include $(DEPENDS) +endif + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/multitail-6.4.2/clipboard.c new/multitail-6.5.0/clipboard.c --- old/multitail-6.4.2/clipboard.c 1970-01-01 01:00:00.000000000 +0100 +++ new/multitail-6.5.0/clipboard.c 2019-11-07 13:56:23.000000000 +0100 @@ -0,0 +1,117 @@ +/* GPLv2 applies + * SVN revision: $Revision$ + * (C) 2006-2019 by folk...@vanheusden.com + */ +#define _LARGEFILE64_SOURCE +#include <fcntl.h> +#include <netinet/in.h> +#include <signal.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> +#include <sys/stat.h> +#include <sys/types.h> + +#include "mt.h" +#include "error.h" +#include "config.h" +#include "utils.h" +#include "term.h" +#include "ui.h" +#include "clipboard.h" + +char *clipboard = "/usr/bin/" CLIPBOARD_NAME; + +void send_to_clipboard_binary(char *what) +{ + int fds[2] = { 0 }; + pid_t pid = -1; + + if (pipe(fds) == -1) + error_exit(TRUE, TRUE, "error creating pipe\n"); + + pid = fork(); + if (pid == -1) + error_exit(TRUE, TRUE, "error forking\n"); + + if (pid == 0) + { + int loop; + + for(loop=0; loop<1024; loop++) + { + if (fds[0] != loop) + close(loop); + } + + signal(SIGHUP, SIG_DFL); + + if (dup(fds[0]) == -1) + error_exit(TRUE, TRUE, "dup() failed\n"); + + setsid(); +#ifndef __minix + setpgid(0, 0); +#endif + + if (execl(clipboard, clipboard, NULL) == -1) + error_exit(TRUE, FALSE, "execl of %s failed\n", clipboard); + + exit(1); + } + + WRITE(fds[1], what, strlen(what), CLIPBOARD_NAME); + + close(fds[1]); + close(fds[0]); +} + +void send_to_clipboard(buffer *pb) +{ + if (file_exist(clipboard) == -1) + error_popup("Copy to clipboard", -1, CLIPBOARD_NAME " program not found"); + else if (getenv("DISPLAY") == NULL) + error_popup("Copy to clipboard", -1, "DISPLAY environment variable not set"); + else + { + char *data = NULL; + int len_out = 0; + int loop = 0; + NEWWIN *mywin = create_popup(9, 40); + +#ifdef __APPLE__ + win_header(mywin, "Copy buffer to clipboard"); +#else + win_header(mywin, "Copy buffer to X clipboard"); +#endif + mydoupdate(); + + for(loop=0; loop<pb -> curpos; loop++) + { + int len = 0; + + if ((pb -> be)[loop].Bline == NULL) + continue; + + len = strlen((pb -> be)[loop].Bline); + + data = (char *)realloc(data, len_out + len + 1); + + memcpy(&data[len_out], (pb -> be)[loop].Bline, len + 1); + + len_out += len; + } + + send_to_clipboard_binary(data); + + free(data); + + mvwprintw(mywin -> win, 3, 2, "Finished!"); + mvwprintw(mywin -> win, 4, 2, "Press any key to continue..."); + mydoupdate(); + + (void)wait_for_keypress(-1, 0, mywin, 0); + + delete_popup(mywin); + } +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/multitail-6.4.2/clipboard.h new/multitail-6.5.0/clipboard.h --- old/multitail-6.4.2/clipboard.h 1970-01-01 01:00:00.000000000 +0100 +++ new/multitail-6.5.0/clipboard.h 2019-11-07 13:56:23.000000000 +0100 @@ -0,0 +1,10 @@ +extern char *clipboard; + +#ifdef __APPLE__ +#define CLIPBOARD_NAME "pbcopy" +#else +#define CLIPBOARD_NAME "xclip" +#endif + +void send_to_clipboard_binary(char *what); +void send_to_clipboard(buffer *pb); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/multitail-6.4.2/cmdline.c new/multitail-6.5.0/cmdline.c --- old/multitail-6.4.2/cmdline.c 2015-02-09 13:52:18.000000000 +0100 +++ new/multitail-6.5.0/cmdline.c 2019-11-07 13:56:23.000000000 +0100 @@ -52,6 +52,7 @@ assert(mode == 'G' || mode == 'g'); *predir = (redirect_t *)myrealloc(*predir, (*n_redirect + 1) * sizeof(redirect_t)); + memset(&(*predir)[*n_redirect], 0x00, sizeof(redirect_t)); if ((*predir)[*n_redirect].type != REDIRECTTO_NONE) error_exit(FALSE, FALSE, "One can only set one redirection-type per (sub-)window.\n"); @@ -86,6 +87,7 @@ int s, sfd = -1; *predir = (redirect_t *)myrealloc(*predir, (*n_redirect + 1) * sizeof(redirect_t)); + memset(&(*predir)[*n_redirect], 0x00, sizeof(redirect_t)); assert(filtered == 1 || filtered == 0); @@ -181,7 +183,7 @@ split++; vertical_split = (int *)myrealloc(vertical_split, split * sizeof(int)); - cur_width = get_value_arg("-sw", pnt, VAL_POSITIVE); + cur_width = get_value_arg("-sw", pnt, VAL_ZERO_POSITIVE); widths = NULL; if (cur_width < 4) @@ -217,7 +219,7 @@ index++; n_win_per_col = (int *)myrealloc(n_win_per_col, index * sizeof(int)); - cur_n = get_value_arg("-sn", pnt, VAL_POSITIVE); + cur_n = get_value_arg("-sn", pnt, VAL_ZERO_POSITIVE); pars = NULL; if (cur_n < 0) @@ -288,9 +290,8 @@ /* wether to invert the reg exp or not */ if ((regex_mode == 'v' || regex_mode == 'm') && invert_regex) - { error_exit(FALSE, FALSE, "-e[m] / -ev cannot be used together with -v\n"); - } + (*pre)[*n_re].invert_regex = invert_regex; /* what to execute (if...) */ @@ -304,13 +305,14 @@ return n_pars_used; } -int argv_color_settings(char *mode, char *pars[], char *allcolor, char *curcolor, int *field_index, char **field_delimiter, myattr_t *cdef, term_t *cur_term_emul, int_array_t *cur_color_schemes, myattr_t *alt_col_cdev1, myattr_t *alt_col_cdev2) +int argv_color_settings(char *mode, char *pars[], char *allcolor, char *curcolor, int *field_index, char **field_delimiter, myattr_t *cdef, term_t *cur_term_emul, int_array_t *cur_color_schemes, myattr_t *alt_col_cdev1, myattr_t *alt_col_cdev2, char *doall) { int n_pars_used = 0; - char cur_mode = mode[2], doall = 0; + char cur_mode = mode[2]; + *doall = 0; if (mode[1] == 'C') - doall = 1; + *doall = 1; if (cur_mode == 's') /* syslog-file coloring? */ { @@ -368,7 +370,7 @@ error_exit(FALSE, FALSE, "Invalid -c mode: '%c'.\n", cur_mode); } - if (doall) + if (*doall) { *allcolor = cur_mode; *curcolor = 'n'; @@ -494,7 +496,7 @@ char no_marker_of_other_window = 0; char bufferwhat = -1; int cur_beep_interval = -1; - + char doallterm = 0; char do_add_timestamp = 0; int_array_t conversions = { NULL, 0, 0 }; @@ -610,7 +612,7 @@ char *prio, *fac, *addr; char filtered; - // -U[af][as] <facil> <prio> host[:port] + /* -U[af][as] <facil> <prio> host[:port] */ if (argv[loop][2] != 'a' && argv[loop][2] != 'f') error_exit(FALSE, FALSE, "-Ux where x needs to be either 'a' or 'f'"); @@ -777,7 +779,7 @@ } else if (argv[loop][0] == '-' && toupper(argv[loop][1]) == 'C') { - loop += argv_color_settings(argv[loop], &argv[loop + 1], &allcolor, &curcolor, &field_index, &field_delimiter, &cdef, &cur_term_emul, &cur_color_schemes, &alt_col_cdev1, &alt_col_cdev2); + loop += argv_color_settings(argv[loop], &argv[loop + 1], &allcolor, &curcolor, &field_index, &field_delimiter, &cdef, &cur_term_emul, &cur_color_schemes, &alt_col_cdev1, &alt_col_cdev2, &doallterm); } else if (strcmp(argv[loop], "-f") == 0) { @@ -1069,7 +1071,8 @@ loop++; cur -> cdef.term_emul = cur_term_emul; - cur_term_emul = TERM_IGNORE; + if (doallterm == 0) + cur_term_emul = TERM_IGNORE; /* redirect input also to a file or pipe */ cur -> n_redirect = n_redirect; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/multitail-6.4.2/config.c new/multitail-6.5.0/config.c --- old/multitail-6.4.2/config.c 2015-02-09 13:52:18.000000000 +0100 +++ new/multitail-6.5.0/config.c 2019-11-07 13:56:23.000000000 +0100 @@ -22,7 +22,7 @@ #include "exec.h" #include "globals.h" #include "config.h" -#include "xclip.h" +#include "clipboard.h" /* "local global" */ int cur_colorscheme_nr = -1; @@ -842,7 +842,15 @@ if (file_exist(par) == -1) error_exit(TRUE, FALSE, "xclip binary '%s' does not exist"); - xclip = strdup(par); + clipboard = strdup(par); +} + +void set_pbcopy(int linenr, char *cmd, char *par) +{ + if (file_exist(par) == -1) + error_exit(TRUE, FALSE, "pbcopy binary '%s' does not exist"); + + clipboard = strdup(par); } void set_map_delete_as_backspace(int linenr, char *cmd, char *par) @@ -1002,6 +1010,11 @@ show_severity_facility = config_yes_no(par); } +void set_scrollback_fullscreen_default(int linenr, char *cmd, char *par) +{ + scrollback_fullscreen_default = config_yes_no(par); +} + void set_scrollback_no_colors(int linenr, char *cmd, char *par) { scrollback_no_colors = config_yes_no(par); @@ -1093,6 +1106,7 @@ { "reuse_searchstring", set_reuse_searchstring }, { "rule", add_filterscheme_rule }, { "scheme", scheme }, + { "scrollback_fullscreen_default", set_scrollback_fullscreen_default }, { "scrollback_no_colors", set_scrollback_no_colors }, { "scrollback_search_new_window", set_scrollback_search_new_window }, { "scrollback_show_winnrs", set_scrollback_show_winnrs }, @@ -1120,7 +1134,10 @@ { "warn_closed", set_warn_closed }, { "window_number", set_window_number }, { "wordwrapmaxlength", set_wordwrapmaxlength }, - { "xclip", set_xclip } + { "xclip", set_xclip }, +#ifdef __APPLE__ + { "pbcopy", set_pbcopy }, +#endif }; int find_config_entry_in_dispatch_table(char *cmd_name) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/multitail-6.4.2/globals.c new/multitail-6.5.0/globals.c --- old/multitail-6.4.2/globals.c 2015-02-09 13:52:18.000000000 +0100 +++ new/multitail-6.5.0/globals.c 2019-11-07 13:56:23.000000000 +0100 @@ -33,7 +33,7 @@ int *n_win_per_col = NULL; int *vertical_split = NULL; color_scheme *cschemes = NULL; -const char *version_str = " --*- multitail " VERSION " (C) 2003-2014 by folk...@vanheusden.com -*--"; +const char *version_str = " --*- multitail " VERSION " (C) 2003-2019 by folk...@vanheusden.com -*--"; conversion *conversions = NULL; keybinding *keybindings = NULL; pars_per_file *ppf = NULL; @@ -145,6 +145,7 @@ char default_sb_showwinnr = 0; char reuse_searchstring = 1; char need_died_procs_check = 0; +char scrollback_fullscreen_default = 0; char scrollback_no_colors = 0; char scrollback_search_new_window = 1; mybool_t posix_tail = 0; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/multitail-6.4.2/globals.h new/multitail-6.5.0/globals.h --- old/multitail-6.4.2/globals.h 2015-02-09 13:52:18.000000000 +0100 +++ new/multitail-6.5.0/globals.h 2019-11-07 13:56:23.000000000 +0100 @@ -137,6 +137,7 @@ extern char *severities[]; extern char *facilities[]; extern char *syslog_ts_format; +extern char scrollback_fullscreen_default; extern char scrollback_no_colors; extern int syslog_port; extern char scrollback_search_new_window; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/multitail-6.4.2/help.c new/multitail-6.5.0/help.c --- old/multitail-6.4.2/help.c 2015-02-10 10:17:07.000000000 +0100 +++ new/multitail-6.5.0/help.c 2019-11-07 13:56:23.000000000 +0100 @@ -601,7 +601,11 @@ "lines. This size can be set with the ^-m^ command-", "line parameter or the ^m^-key in the main menu.", " ^c^ set colors", +#ifdef __APPLE__ + " ^x^ copy contents to clipboard (pbcopy)", +#else " ^x^ copy contents to X clipboard (xclip)", +#endif " ^f^/^/^ search for a string in the buffer", " ^n^ find the next occurence", " ^Y^ toggle linewrap. if linewrap is disabled,", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/multitail-6.4.2/makefile.aix new/multitail-6.5.0/makefile.aix --- old/multitail-6.4.2/makefile.aix 2014-05-01 14:54:06.000000000 +0200 +++ new/multitail-6.5.0/makefile.aix 2019-11-07 13:56:23.000000000 +0100 @@ -6,7 +6,7 @@ LDFLAGS=-L/usr/local/lib/ -lpanel -lncurses -lm $(DEBUG) CFLAGS=-I/usr/local/include/ -fsigned-char -DAIX -O2 -DVERSION=\"$(VERSION)\" $(DEBUG) -DCONFIG_FILE=\"$(CONFIG_FILE)\" -OBJS=utils.o mt.o error.o my_pty.o term.o scrollback.o help.o mem.o cv.o selbox.o stripstring.o color.o misc.o ui.o exec.o diff.o config.o cmdline.o globals.o history.o +OBJS=utils.o mt.o error.o my_pty.o term.o scrollback.o help.o mem.o cv.o selbox.o stripstring.o color.o misc.o ui.o exec.o diff.o config.o cmdline.o globals.o history.o clipboard.o all: multitail diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/multitail-6.4.2/makefile.cross-arm-linux new/multitail-6.5.0/makefile.cross-arm-linux --- old/multitail-6.4.2/makefile.cross-arm-linux 2014-05-01 14:54:06.000000000 +0200 +++ new/multitail-6.5.0/makefile.cross-arm-linux 2019-11-07 13:56:23.000000000 +0100 @@ -6,7 +6,7 @@ LDFLAGS=-lpanel -lncurses -lutil -lm $(DEBUG) CFLAGS=-D$(shell uname) -O2 -Wall -DVERSION=\"$(VERSION)\" $(DEBUG) -DCONFIG_FILE=\"$(CONFIG_FILE)\" -OBJS=utils.o mt.o error.o my_pty.o term.o scrollback.o help.o mem.o cv.o selbox.o stripstring.o color.o misc.o ui.o exec.o diff.o config.o cmdline.o globals.o history.o +OBJS=utils.o mt.o error.o my_pty.o term.o scrollback.o help.o mem.o cv.o selbox.o stripstring.o color.o misc.o ui.o exec.o diff.o config.o cmdline.o globals.o history.o clipboard.o all: multitail diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/multitail-6.4.2/makefile.cygwin new/multitail-6.5.0/makefile.cygwin --- old/multitail-6.4.2/makefile.cygwin 2014-05-01 14:54:06.000000000 +0200 +++ new/multitail-6.5.0/makefile.cygwin 2019-11-07 13:56:23.000000000 +0100 @@ -6,7 +6,7 @@ LDFLAGS=-lpanel -lncurses -lm $(DEBUG) CFLAGS=-D__CYGWIN__ -O2 -Wall -DVERSION=\"$(VERSION)\" $(DEBUG) -DCONFIG_FILE=\"$(CONFIG_FILE)\" -OBJS=utils.o mt.o error.o my_pty.o term.o scrollback.o help.o mem.o cv.o selbox.o stripstring.o color.o misc.o ui.o exec.o diff.o config.o cmdline.o globals.o history.o +OBJS=utils.o mt.o error.o my_pty.o term.o scrollback.o help.o mem.o cv.o selbox.o stripstring.o color.o misc.o ui.o exec.o diff.o config.o cmdline.o globals.o history.o clipboard.o all: multitail diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/multitail-6.4.2/makefile.hpux new/multitail-6.5.0/makefile.hpux --- old/multitail-6.4.2/makefile.hpux 2014-05-01 14:54:06.000000000 +0200 +++ new/multitail-6.5.0/makefile.hpux 2019-11-07 13:56:23.000000000 +0100 @@ -5,7 +5,7 @@ LDFLAGS=-L/usr/local/lib/ -lpanel -lncurses -lm CFLAGS=-Ae -I/usr/local/include/ -O -DVERSION=\"$(VERSION)\" -DCONFIG_FILE=\"$(CONFIG_FILE)\" -OBJS=utils.o mt.o error.o my_pty.o term.o scrollback.o help.o mem.o cv.o selbox.o stripstring.o color.o misc.o ui.o exec.o diff.o config.o cmdline.o globals.o history.o +OBJS=utils.o mt.o error.o my_pty.o term.o scrollback.o help.o mem.o cv.o selbox.o stripstring.o color.o misc.o ui.o exec.o diff.o config.o cmdline.o globals.o history.o clipboard.o all: multitail diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/multitail-6.4.2/makefile.icc new/multitail-6.5.0/makefile.icc --- old/multitail-6.4.2/makefile.icc 2014-05-01 14:54:06.000000000 +0200 +++ new/multitail-6.5.0/makefile.icc 2019-11-07 13:56:23.000000000 +0100 @@ -7,7 +7,7 @@ LDFLAGS=-lpanel -lncurses -lutil -lm $(DEBUG) CFLAGS+=-D$(shell uname) -O2 -DVERSION=\"$(VERSION)\" $(DEBUG) -DCONFIG_FILE=\"$(CONFIG_FILE)\" -OBJS=utils.o mt.o error.o my_pty.o term.o scrollback.o help.o mem.o cv.o selbox.o stripstring.o color.o misc.o ui.o exec.o diff.o config.o cmdline.o globals.o history.o +OBJS=utils.o mt.o error.o my_pty.o term.o scrollback.o help.o mem.o cv.o selbox.o stripstring.o color.o misc.o ui.o exec.o diff.o config.o cmdline.o globals.o history.o clipboard.o all: multitail diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/multitail-6.4.2/makefile.irix new/multitail-6.5.0/makefile.irix --- old/multitail-6.4.2/makefile.irix 2014-05-01 14:54:06.000000000 +0200 +++ new/multitail-6.5.0/makefile.irix 2019-11-07 13:56:23.000000000 +0100 @@ -6,7 +6,7 @@ LDFLAGS=-lpanel -lncurses -lm $(DEBUG) CFLAGS=-I/usr/freeware/include/ncurses/ -DIRIX -DVERSION=\"$(VERSION)\" -signed $(DEBUG) -DCONFIG_FILE=\"$(CONFIG_FILE)\" -OBJS=utils.o mt.o error.o my_pty.o term.o scrollback.o help.o mem.o cv.o selbox.o stripstring.o color.o misc.o ui.o exec.o diff.o config.o cmdline.o globals.o history.o +OBJS=utils.o mt.o error.o my_pty.o term.o scrollback.o help.o mem.o cv.o selbox.o stripstring.o color.o misc.o ui.o exec.o diff.o config.o cmdline.o globals.o history.o clipboard.o all: multitail diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/multitail-6.4.2/makefile.macosx new/multitail-6.5.0/makefile.macosx --- old/multitail-6.4.2/makefile.macosx 2015-03-16 11:38:21.000000000 +0100 +++ new/multitail-6.5.0/makefile.macosx 2019-11-07 13:56:23.000000000 +0100 @@ -1,28 +1,33 @@ include version -CONFIG_FILE=$(DESTDIR)/etc/multitail.conf +CONFIG_FILE=$(DESTDIR)/usr/local/etc/multitail.conf -DEBUG=#-g -D_DEBUG #-pg #-fprofile-arcs -LDFLAGS=-lpanel -lncurses -lm $(DEBUG) -CFLAGS=-O2 -D$(shell uname) -DVERSION=\"$(VERSION)\" $(DEBUG) -DCONFIG_FILE=\"$(CONFIG_FILE)\" +DEBUG:=#XXX -g -D_DEBUG #-pg -Wpedantic # -pg #-fprofile-arcs +LDFLAGS=-lpanel -lm $(DEBUG) +CPPFLAGS:=$(shell pkg-config --cflags ncurses) +NCURSES_LIB:=$(shell pkg-config --libs ncurses) +# pkg-config --libs --cflags ncurses +# -D_DARWIN_C_SOURCE -I/opt/local/include -L/opt/local/lib -lncurses +PLATFORM:=$(shell uname) +CFLAGS=-O2 -Wall -Wextra -std=c99 -D$(PLATFORM) -DVERSION=\"$(VERSION)\" $(DEBUG) -DCONFIG_FILE=\"$(CONFIG_FILE)\" -OBJS=utils.o mt.o error.o my_pty.o term.o scrollback.o help.o mem.o cv.o selbox.o stripstring.o color.o misc.o ui.o exec.o diff.o config.o cmdline.o globals.o history.o xclip.o +OBJS=utils.o mt.o error.o my_pty.o term.o scrollback.o help.o mem.o cv.o selbox.o stripstring.o color.o misc.o ui.o exec.o diff.o config.o cmdline.o globals.o history.o clipboard.o all: multitail multitail: $(OBJS) - $(CC) -Wall -W $(OBJS) $(LDFLAGS) -o multitail + $(CC) -Wall -W $(OBJS) $(NCURSES_LIB) $(LDFLAGS) -o multitail install: multitail - cp multitail $(DESTDIR)/usr/bin - cp multitail.1 $(DESTDIR)/usr/share/man/man1/multitail.1 + cp multitail $(DESTDIR)/usr/local/bin + cp multitail.1 $(DESTDIR)/usr/local/share/man/man1/multitail.1 # ### COPIED multitail.conf.new, YOU NEED TO REPLACE THE multitail.conf ### YOURSELF WITH THE NEW FILE # - cp multitail.conf $(DESTDIR)/etc/multitail.conf.new - mkdir -p $(DESTDIR)/usr/share/doc/multitail-$(VERSION) - cp *.txt INSTALL manual.html $(DESTDIR)/usr/share/doc/multitail-$(VERSION) + cp multitail.conf $(DESTDIR)/usr/local/etc/multitail.conf.new + mkdir -p $(DESTDIR)/usr/local/share/doc/multitail-$(VERSION) + cp *.txt INSTALL manual.html $(DESTDIR)/usr/local/share/doc/multitail-$(VERSION) # # +-=-------------------------------------------------------------=-+ # | There's a mailinglist! | @@ -35,26 +40,13 @@ # http://www.vanheusden.com/wishlist.php uninstall: clean - rm -f $(DESTDIR)/usr/bin/multitail - rm -f $(DESTDIR)/usr/share/man/man1/multitail.1 - rm -rf $(DESTDIR)/usr/share/doc/multitail-$(VERSION) + rm -f $(DESTDIR)/usr/local/bin/multitail + rm -f $(DESTDIR)/usr/local/share/man/man1/multitail.1 + rm -rf $(DESTDIR)/usr/local/share/doc/multitail-$(VERSION) clean: rm -f $(OBJS) multitail core -macosxbinpackage: multitail - # as it is rather tricky to install something in /etc on MacOS X, - # we're skipping it here - rm -rf usr - mkdir -p usr/bin - mkdir -p usr/share/man/man1 - mkdir -p usr/share/doc/multitail-$(VERSION) - cp multitail usr/bin - cp multitail.1 usr/share/man/man1 - cp *.txt INSTALL manual.html usr/share/doc/multitail-$(VERSION) - tar cvzf multitail-$(VERSION)-macosx.tgz usr - rm -rf usr - package: clean # source package rm -rf multitail-$(VERSION)* diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/multitail-6.4.2/makefile.minix new/multitail-6.5.0/makefile.minix --- old/multitail-6.4.2/makefile.minix 2014-05-01 14:54:06.000000000 +0200 +++ new/multitail-6.5.0/makefile.minix 2019-11-07 13:56:23.000000000 +0100 @@ -7,7 +7,7 @@ LDFLAGS+=-L/usr/pkg/lib -lpanel -lncurses -lutil -lm $(DEBUG) -rdynamic CFLAGS+=-funsigned-char -D`uname` -O2 -Wall -DVERSION=\"$(VERSION)\" $(DEBUG) -DCONFIG_FILE=\"$(CONFIG_FILE)\" -I/usr/pkg/include -OBJS=utils.o mt.o error.o my_pty.o term.o scrollback.o help.o mem.o cv.o selbox.o stripstring.o color.o misc.o ui.o exec.o diff.o config.o cmdline.o globals.o history.o +OBJS=utils.o mt.o error.o my_pty.o term.o scrollback.o help.o mem.o cv.o selbox.o stripstring.o color.o misc.o ui.o exec.o diff.o config.o cmdline.o globals.o history.o clipboard.o all: multitail diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/multitail-6.4.2/makefile.sco-openserver6 new/multitail-6.5.0/makefile.sco-openserver6 --- old/multitail-6.4.2/makefile.sco-openserver6 2014-05-01 14:54:06.000000000 +0200 +++ new/multitail-6.5.0/makefile.sco-openserver6 2019-11-07 13:56:23.000000000 +0100 @@ -6,7 +6,7 @@ LDFLAGS=-L/usr/local/lib/ -lpanel -lncurses -lm -lsocket $(DEBUG) CFLAGS=-Dscoos -O2 -I/usr/local/include/ -DVERSION=\"$(VERSION)\" $(DEBUG) -DCONFIG_FILE=\"$(CONFIG_FILE)\" -OBJS=utils.o mt.o error.o my_pty.o term.o scrollback.o help.o mem.o cv.o selbox.o stripstring.o color.o misc.o ui.o exec.o diff.o config.o cmdline.o globals.o history.o +OBJS=utils.o mt.o error.o my_pty.o term.o scrollback.o help.o mem.o cv.o selbox.o stripstring.o color.o misc.o ui.o exec.o diff.o config.o cmdline.o globals.o history.o clipboard.o all: multitail diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/multitail-6.4.2/makefile.solaris_gcc new/multitail-6.5.0/makefile.solaris_gcc --- old/multitail-6.4.2/makefile.solaris_gcc 2014-05-01 14:54:06.000000000 +0200 +++ new/multitail-6.5.0/makefile.solaris_gcc 2019-11-07 13:56:23.000000000 +0100 @@ -8,7 +8,7 @@ CFLAGS=${EXTRA_CFLAGS} -O2 -I/usr/local/include/ -DVERSION=\"$(VERSION)\" $(DEBUG) -DCONFIG_FILE=\"$(CONFIG_FILE)\" LDFLAGS=${EXTRA_LDFLAGS} -L/usr/local/lib/ -lsocket -lpanel -lncurses -lnsl -lm $(DEBUG) -OBJS=utils.o mt.o error.o my_pty.o term.o scrollback.o help.o mem.o cv.o color.o stripstring.o selbox.o misc.o ui.o exec.o diff.o config.o cmdline.o globals.o history.o +OBJS=utils.o mt.o error.o my_pty.o term.o scrollback.o help.o mem.o cv.o color.o stripstring.o selbox.o misc.o ui.o exec.o diff.o config.o cmdline.o globals.o history.o clipboard.o all: multitail diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/multitail-6.4.2/makefile.solaris_sunwspro new/multitail-6.5.0/makefile.solaris_sunwspro --- old/multitail-6.4.2/makefile.solaris_sunwspro 2014-05-01 14:54:06.000000000 +0200 +++ new/multitail-6.5.0/makefile.solaris_sunwspro 2019-11-07 13:56:23.000000000 +0100 @@ -7,7 +7,7 @@ CFLAGS=${EXTRA_CFLAGS} -O2 -I/usr/local/include/ -D_STDC_C99 -DVERSION=\"$(VERSION)\" $(DEBUG) -DCONFIG_FILE=\"$(CONFIG_FILE)\" LDFLAGS=${EXTRA_LDFLAGS} -L/usr/local/lib/ -lsocket -lpanel -lncurses -lnsl -lm $(DEBUG) -OBJS=utils.o mt.o error.o my_pty.o term.o scrollback.o help.o mem.o cv.o color.o stripstring.o selbox.o misc.o ui.o exec.o diff.o config.o cmdline.o globals.o history.o +OBJS=utils.o mt.o error.o my_pty.o term.o scrollback.o help.o mem.o cv.o color.o stripstring.o selbox.o misc.o ui.o exec.o diff.o config.o cmdline.o globals.o history.o clipboard.o all: multitail diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/multitail-6.4.2/makefile.tru64 new/multitail-6.5.0/makefile.tru64 --- old/multitail-6.4.2/makefile.tru64 2014-05-01 14:54:06.000000000 +0200 +++ new/multitail-6.5.0/makefile.tru64 2019-11-07 13:56:23.000000000 +0100 @@ -5,7 +5,7 @@ LDFLAGS=-lutil -lm -lpanel -lncurses CFLAGS=-Ae -DOSF1 -O -DVERSION=\"$(VERSION)\" -DCONFIG_FILE=\"$(CONFIG_FILE)\" -OBJS=utils.o mt.o error.o my_pty.o term.o scrollback.o help.o mem.o cv.o selbox.o stripstring.o color.o misc.o ui.o exec.o diff.o config.o cmdline.o globals.o history.o +OBJS=utils.o mt.o error.o my_pty.o term.o scrollback.o help.o mem.o cv.o selbox.o stripstring.o color.o misc.o ui.o exec.o diff.o config.o cmdline.o globals.o history.o clipboard.o all: multitail diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/multitail-6.4.2/misc.c new/multitail-6.5.0/misc.c --- old/multitail-6.4.2/misc.c 2014-05-01 14:54:06.000000000 +0200 +++ new/multitail-6.5.0/misc.c 2019-11-07 13:56:23.000000000 +0100 @@ -46,7 +46,7 @@ { line++; mvwprintw(mywin -> win, line++, 2, "Running on:"); -#ifdef _GNU_SOURCE +#if defined(_GNU_SOURCE) && !defined(__APPLE__) mvwprintw(mywin -> win, line++, 2, "%s/%s %s %s", uinfo.nodename, uinfo.sysname, uinfo.machine, uinfo.domainname); #else mvwprintw(mywin -> win, line++, 2, "%s/%s %s", uinfo.nodename, uinfo.sysname, uinfo.machine); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/multitail-6.4.2/mt.c new/multitail-6.5.0/mt.c --- old/multitail-6.4.2/mt.c 2015-02-09 13:52:18.000000000 +0100 +++ new/multitail-6.5.0/mt.c 2019-11-07 13:56:23.000000000 +0100 @@ -34,9 +34,9 @@ /* syslog receive */ #include <sys/types.h> #include <sys/socket.h> +#include <netdb.h> #include <netinet/in.h> #include <arpa/inet.h> -#include <netdb.h> #ifdef UTF8_SUPPORT #include <wchar.h> #include <wctype.h> @@ -457,6 +457,9 @@ { int match_offset; + if (!matches) + return 0; + for(match_offset=0; match_offset<MAX_N_RE_MATCHES; match_offset++) { char matching; @@ -617,8 +620,14 @@ #ifdef UTF8_SUPPORT const char *dummy = &use_string[offset]; - wchar_t wcur = 0; - mbsrtowcs(&wcur, &dummy, 1, NULL); + + wchar_t wcur = '?'; + static mbstate_t state; + + if (mbsrtowcs(&wcur, &dummy, 1, &state) == -1) { + wcur = '?'; + memset(&state, 0x00, sizeof(mbstate_t)); + } #else char wcur = use_string[offset]; #endif @@ -692,7 +701,9 @@ if (!is_control_or_extended_ascii) { -#ifdef UTF8_SUPPORT +#if defined(UTF8_SUPPORT) && defined(NCURSES_WIDECHAR) +// FIXME warning: implicit declaration of function ‘waddnwstr’ is invalid in C99 [-Wimplicit-function-declaration] +// see /usr/include/ncurses.h waddnwstr(win -> win, &wcur, 1); #else wprintw(win -> win, "%c", wcur); @@ -1342,7 +1353,6 @@ { if (mode_statusline > 0 && status != NULL && cur != NULL) { - int dx; myattr_t attrs = statusline_attrs; int statusline_len = 0; off64_t fsize = (off64_t)-1; @@ -3092,6 +3102,8 @@ } /* check all matched files */ cdg[loop].last_check = now; + + globfree(&files); } /* time for a check? */ } /* check all search patterns */ @@ -3208,8 +3220,6 @@ if (strchr(&data_in[new_data_offset], '\n')) { - char emitted = 0; - if (cur -> cont) /* reconnect lines with '\' */ { char *contsearch = pnt; @@ -3220,6 +3230,16 @@ } } + if (cur -> restart.is_restarted && cur -> restart.restart_clear) + { +delete_be_in_buffer(&lb[win_nr]); + cur -> restart.is_restarted = 0; + werase(pi[win_nr].data -> win); + } + + update_panels(); + + /* display lines */ for(;*pnt;) { @@ -3269,20 +3289,6 @@ statusline_update_needed |= emit_to_buffer_and_term(win_nr, cur, pnt); } - - if (!emitted) - { - emitted = 1; - - if (cur -> restart.is_restarted && cur -> restart.restart_clear) - { - cur -> restart.is_restarted = 0; - werase(pi[win_nr].data -> win); - } - - update_panels(); - } - pnt = end + 1; } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/multitail-6.4.2/mt.h new/multitail-6.5.0/mt.h --- old/multitail-6.4.2/mt.h 2014-05-01 14:54:06.000000000 +0200 +++ new/multitail-6.5.0/mt.h 2019-11-07 13:56:23.000000000 +0100 @@ -59,11 +59,14 @@ #define __USE_BSD /* manpage says _BSD_SOURCE, stdlib.h says __USE_BSD */ #endif -#ifdef UTF8_SUPPORT +#if defined(UTF8_SUPPORT) && !defined(__APPLE__) #include <ncursesw/panel.h> #include <ncursesw/ncurses.h> #else - #if defined(sun) || defined(__sun) || defined(scoos) || defined(_HPUX_SOURCE) || defined(AIX) || defined(__CYGWIN__) + #if defined(__APPLE__) + #include <ncurses.h> + #include <panel.h> + #elif defined(sun) || defined(__sun) || defined(scoos) || defined(_HPUX_SOURCE) || defined(AIX) || defined(__CYGWIN__) #include <ncurses/panel.h> #include <ncurses/ncurses.h> #else diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/multitail-6.4.2/multitail.1 new/multitail-6.5.0/multitail.1 --- old/multitail-6.4.2/multitail.1 2014-05-01 14:54:06.000000000 +0200 +++ new/multitail-6.5.0/multitail.1 2019-11-07 13:56:23.000000000 +0100 @@ -8,7 +8,7 @@ .SH NAME MultiTail \- browse through several files at once .SH SYNOPSIS -.BI "MultiTail [" options "] +.BI "multitail [" options "] .sp options: .BI "[\-cs|\-Cs|\-c\-] [\-s] [\-i] inputfile [\-i anotherinputfile] [...]" @@ -83,10 +83,10 @@ Close windows when more then 'x' seconds no new data was processed. .TP .B "\-a x" -Write the output also to file 'x' (like 'tee') AFTER it was filtered by MultiTail. +Write the output also to file 'x' (like 'tee') AFTER it was filtered by MultiTail. Note: you need to put "-a file" BEFORE to the file you're monitoring! .TP .B "\-A x" -Write the output also to file 'x' (like 'tee') BEFORE it was filtered by MultiTail. +Write the output also to file 'x' (like 'tee') BEFORE it was filtered by MultiTail. Also see the note for "-a". .TP .B "-g x" Send the output also to command 'x' AFTER it was filtered by MultiTail. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/multitail-6.4.2/multitail.conf new/multitail-6.5.0/multitail.conf --- old/multitail-6.4.2/multitail.conf 2015-06-24 15:17:48.000000000 +0200 +++ new/multitail-6.5.0/multitail.conf 2019-11-07 13:56:23.000000000 +0100 @@ -1,7 +1,7 @@ # Format of this file: # # include:configfile -# Also pars 'configfile'. +# Also parse 'configfile'. # # defaultcscheme:<name of colorscheme> # Selects the default color scheme to use. If this one is set, you @@ -18,7 +18,7 @@ # color: [fg],[bg],[attribute[/otherattribute]][|other colorpair+attribute] # e.g.: red,,bold|red would give bold red for line 1 and just red for line 2, etc. # Possible colors: red, green, yellow, blue, magenta, cyan and white. -# +# For 256 colors support, you just have to use the color number of the ANSI 256 color scheme. # # cs_re_s:<color>:<regular expression> # Like cs_re but only the substrings are used(!). E.g.: @@ -40,7 +40,7 @@ # mcsre_s:color:regexp # mcsre_val_less/bigger/equal:color:regexp # These work like their cs_re* sisters only they merge their -# attributes (colors, bold, bright, etd) with the previous +# attributes (colors, bold, bright, etc.) with the previous # merging one. # # scheme:<name of colorscheme>:<regular expression> @@ -84,7 +84,7 @@ # red or so # # markerline_timestamp -# sets wether to put a timestamp in the markerline (1) or not (0) +# sets whether to put a timestamp in the markerline (1) or not (0) # # ts_format:<format> # format of timestamps. see the man-page of 'strftime' for a list @@ -229,7 +229,9 @@ # # apache colorscheme:apache:default Apache logging (webserver) -cs_re:red: 404 +cs_re:yellow:"[ ]1[0-9][0-9][ ] +cs_re:green:"[ ][2-3][0-9][0-9][ ] +cs_re:red:"[ ][4-5][0-9][0-9][ ] cs_re:cyan:: cs_re:green:\[ cs_re:green:\] @@ -671,6 +673,24 @@ cs_re_s:red:^[^ ]* *[^,]*,[0-9]* *[0-9]* *(ERROR) *[^ ]* [^ ]* *(.*)$ cs_re_s:red,,bold:^[^ ]* *[^,]*,[0-9]* *[0-9]* *(FATAL) *[^ ]* [^ ]* *(.*)$ cs_re_s:white,,bold:^[^ ]* *[^,]*,[0-9]* *[0-9]* *[A-Z]* *(.*) + +#log4jnew +colorscheme:log4jnew +cs_re:red,yellow,bold:ERROR +cs_re:red,yellow,bold:FATAL +cs_re:yellow:INFO +cs_re:green:WARN +#Date +cs_re_s:yellow:([0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2},[0-9]{3}) +#Thread +cs_re_s:cyan: (\[.*\]) +#Class +cs_re:cyan:[INFO|WARNING|ERROR|DEBUG|FATAL]\ ([a-zA-Z0-9\.]*)\ +#Numbers +cs_re:magenta: ([0-9]{2,}) +#Keywords +cs_re_s:green:(UNKNOWN|localhost|handling) + # # LambdaMOO colorscheme:lambdamoo:MUD/MOO server http://www.moo.mud.org/ @@ -994,6 +1014,10 @@ # to the X clipboard #xclip:/usr/bin/xclip # +# where to find the 'pbcopy' binary - used to send a buffer +# to the clipboard (OSX-only) +#pbcopy:/usr/bin/pbcopy +# # width of a TAB-character. in the VI editor this is, for # example, 8. default in multitail is 4 tab_stop:8 @@ -1134,7 +1158,7 @@ # what to buffer by default 'a'll or what went through the 'f'ilter default_bufferwhat:f # -# should searches be case insentive? press 'I' in the main menu to toggle at run-time +# should searches be case insensitive? press 'I' in the main menu to toggle at run-time searches_case_insensitive:no # # default linewrap mode @@ -1157,7 +1181,7 @@ usefilterscheme:syslog:/var/log/messages # # edits (part of lines) -# the type (e.g. 'ke') is like the commandswitch -ke/-kS/-kr etc. +# the type (e.g. 'ke') is like the command line switches -ke/-kS/-kr etc. editscheme:syslog:removes '----' editrule:ke:---- editrule:ke:make @@ -1207,7 +1231,7 @@ # for word-wrap: what is the max length of a word which should still be wrapped wordwrapmaxlength:31 # -# for searches, multitail can remeber a history which can be retrieved with ^r or cursorkey down in places where +# for searches, multitail can remember a history which can be retrieved with ^r or cursorkey down in places where # you can enter searchstrings # set 'history_size' to 0 to disable this feature searchhistory_file:~/.multitail.searchhistory @@ -1251,6 +1275,9 @@ # show severity/facility? not shown in regular syslogd show_severity_facility:yes # +# should scrollback default to fullscreen (default is no) +# scrollback_fullscreen_default:yes +# # suppress colors in the scollback window? this speeds up scrolling a little scrollback_no_colors:no # diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/multitail-6.4.2/scrollback.c new/multitail-6.5.0/scrollback.c --- old/multitail-6.4.2/scrollback.c 2015-02-10 10:17:38.000000000 +0100 +++ new/multitail-6.5.0/scrollback.c 2019-11-07 13:56:23.000000000 +0100 @@ -19,7 +19,7 @@ #include "ui.h" #include "misc.h" #include "globals.h" -#include "xclip.h" +#include "clipboard.h" int scrollback_search_to_new_window(buffer *pbuf, char *org_title, char *find_str, mybool_t case_insensitive); @@ -211,20 +211,67 @@ } } + +void compute_text_dimensions(int *nlines, int *ncols, char fullscreen) +{ + if (fullscreen) + { + *nlines = max_y; + *ncols = max_x; + } + else + { + *nlines = max_y - 6; + *ncols = max_x - 6; + } +} + +void create_scrollback_windows(NEWWIN **mywin1, NEWWIN **mywin2, int nlines, int ncols, char fullscreen) +{ + /* Delete existing windows, if any. */ + if (*mywin1) + { + delete_popup(*mywin1); + } + + if (*mywin2) + { + delete_popup(*mywin2); + } + + /* Re-create windows, according to fullscreen flag */ + if (fullscreen) + { + *mywin1 = NULL; + *mywin2 = create_popup(max_y, max_x); + scrollok((*mywin2) -> win, FALSE); /* supposed to always return OK, according to the manpage */ + + } + else + { + *mywin1 = create_popup(max_y - 4, max_x - 4); + *mywin2 = create_popup(nlines, ncols); + scrollok((*mywin2) -> win, FALSE); /* supposed to always return OK, according to the manpage */ + } +} + int scrollback_do(int window_nr, buffer *pbuf, int *winnrs, char *header) { int rc = 0; char *find = NULL; - NEWWIN *mywin1, *mywin2; - int nlines = max_y - 6, ncols = max_x - 6; - int offset = max(0, pbuf -> curpos - nlines); // FIXME: aantal regels laten afhangen van lengte + char fullscreen = scrollback_fullscreen_default; + NEWWIN *mywin1 = NULL, *mywin2 = NULL; + + int nlines, ncols; + compute_text_dimensions(&nlines, &ncols, fullscreen); + + int offset = max(0, pbuf -> curpos - nlines); /* FIXME: aantal regels laten afhangen van lengte */ char redraw = 2; int line_offset = 0; char show_winnr = default_sb_showwinnr; mybool_t case_insensitive = re_case_insensitive; buffer cur_lb; int loop = 0; - char fullscreen = 0; memset(&cur_lb, 0x00, sizeof(cur_lb)); @@ -254,9 +301,7 @@ find = mystrdup(global_highlight_str); } - mywin1 = create_popup(max_y - 4, max_x - 4); - mywin2 = create_popup(nlines, ncols); - scrollok(mywin2 -> win, FALSE); /* supposed to always return OK, according to the manpage */ + create_scrollback_windows(&mywin1, &mywin2, nlines, ncols, fullscreen); for(;;) { @@ -362,25 +407,11 @@ } else if (c == KEY_F(9) || c == 23) /* ^w */ { - if (fullscreen) - { - delete_popup(mywin2); - - mywin1 = create_popup(max_y - 4, max_x - 4); - mywin2 = create_popup(nlines, ncols); - scrollok(mywin2 -> win, FALSE); /* supposed to always return OK, according to the manpage */ - } - else - { - delete_popup(mywin1); - delete_popup(mywin2); - - mywin1 = NULL; - mywin2 = create_popup(max_y, max_x); - scrollok(mywin2 -> win, FALSE); /* supposed to always return OK, according to the manpage */ - } - fullscreen = ! fullscreen; + + compute_text_dimensions(&nlines, &ncols, fullscreen); + + create_scrollback_windows(&mywin1, &mywin2, nlines, ncols, fullscreen); redraw = 2; } @@ -436,7 +467,7 @@ c == 'y' || c == 25 || /* ^y */ c == 'k' || - /* c == 11 || *//* ^k */ + /* c == 11 || */ /* ^k */ c == 16) /* ^p */ && (offset > 0 || (!no_linewrap && line_offset > 0))) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/multitail-6.4.2/term.c new/multitail-6.5.0/term.c --- old/multitail-6.4.2/term.c 2015-02-09 13:52:18.000000000 +0100 +++ new/multitail-6.5.0/term.c 2019-11-07 13:56:23.000000000 +0100 @@ -699,9 +699,12 @@ return 0; } + int colorstr_to_nr(char *str) { int loop; + int err; + regex_t regex_is_color; if (str[0] == 0x00) return -1; @@ -710,7 +713,24 @@ if (color_names[loop] && strcmp(color_names[loop], str) == 0) return loop; } + + err = regcomp(®ex_is_color, "^[[:digit:]]{1,3}$", REG_EXTENDED); + if (err == 0) { + int match_color; + match_color = regexec(®ex_is_color, str, 0, NULL, 0); + regfree(®ex_is_color); + if (match_color == 0) { + int color; + char *end; + color = strtol(str,&end,10); + /* prevent the use of more thant 255 colors */ + if (color < 255) { + return color; + } + } + } + if (use_colors) error_exit(FALSE, FALSE, "'%s' is not recognized as a color\n", str); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/multitail-6.4.2/utils.c new/multitail-6.5.0/utils.c --- old/multitail-6.4.2/utils.c 2015-08-12 15:36:37.000000000 +0200 +++ new/multitail-6.5.0/utils.c 2019-11-07 13:56:23.000000000 +0100 @@ -175,20 +175,22 @@ /** stop_process * - in: int pid pid of process * - returns: nothing - * this function sends a TERM-signal to the given process, sleeps for 1009 microseconds + * this function sends a TERM-signal to the given process, sleeps for 1000 microseconds * and then sends a KILL-signal to the given process if it still exists. the TERM signal - * is send so the process gets the possibility to gracefully exit. if it doesn't do that - * in 100 microseconds, it is terminated + * is sent so the process gets the possibility to gracefully exit. if it doesn't do that + * in 1000 microseconds, it is terminated */ void stop_process(pid_t pid) { assert(pid > 1); +#ifndef __APPLE__ if (mykillpg(pid, SIGTERM) == -1) { if (errno != ESRCH) error_exit(TRUE, FALSE, "Problem stopping child process with PID %d (SIGTERM).\n", pid); } +#endif usleep(1000); @@ -201,12 +203,26 @@ /* ...and then really terminate the process */ if (mykillpg(pid, SIGKILL) == -1) { +#ifdef __APPLE__ + /* don't exit if the error is EPERM: macOS doesn't allow + you to kill a process that has been already killed + (i.e. zombies), which is what we did with the second + mykillpg above. */ + if (errno != ESRCH && errno != EPERM) +#else if (errno != ESRCH) +#endif error_exit(TRUE, FALSE, "Problem stopping child process with PID %d (SIGKILL).\n", pid); } } +#ifdef __APPLE__ + else if (errno != ESRCH && errno != EPERM) +#else else if (errno != ESRCH) +#endif + { error_exit(TRUE, FALSE, "Problem stopping child process with PID %d (SIGTERM).\n", pid); + } /* wait for the last remainder of the died process to go away, * otherwhise we'll find zombies on our way @@ -216,6 +232,29 @@ if (errno != ECHILD) error_exit(TRUE, FALSE, "waitpid() failed\n"); } + +#ifdef __APPLE__ + /* since we ignored the case of a EPERM error above, + check if the process got stopped regardless or + if we actually failed to stop it */ + BOOL process_gone = FALSE; + for (int i = 0; i < 10; i++) + { + if (i != 0) + usleep(1000); + if (mykillpg(pid, 0) == -1) + { + if (errno == ESRCH) + { + process_gone = TRUE; + break; + } + } + } + + if (!process_gone) + error_exit(TRUE, FALSE, "Could not confirm that child process with PID %d has been stopped.\n", pid); +#endif } /** delete_array @@ -434,9 +473,8 @@ double get_ts(void) { struct timeval ts; - struct timezone tz; - if (gettimeofday(&ts, &tz) == -1) + if (gettimeofday(&ts, NULL) == -1) error_exit(TRUE, FALSE, "gettimeofday() failed"); return (((double)ts.tv_sec) + ((double)ts.tv_usec)/1000000.0); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/multitail-6.4.2/version new/multitail-6.5.0/version --- old/multitail-6.4.2/version 2015-09-24 09:08:39.000000000 +0200 +++ new/multitail-6.5.0/version 2019-11-07 13:56:34.000000000 +0100 @@ -1 +1 @@ -VERSION=6.4.2 +VERSION=6.5.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/multitail-6.4.2/xclip.c new/multitail-6.5.0/xclip.c --- old/multitail-6.4.2/xclip.c 2014-05-01 14:54:06.000000000 +0200 +++ new/multitail-6.5.0/xclip.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,111 +0,0 @@ -/* GPLv2 applies - * SVN revision: $Revision$ - * (C) 2006-2014 by folk...@vanheusden.com - */ -#define _LARGEFILE64_SOURCE -#include <fcntl.h> -#include <signal.h> -#include <stdlib.h> -#include <string.h> -#include <unistd.h> -#include <sys/stat.h> -#include <sys/types.h> - -#include "mt.h" -#include "error.h" -#include "config.h" -#include "utils.h" -#include "term.h" -#include "ui.h" - -char *xclip = "/usr/bin/xclip"; - -void send_to_xclip(char *what) -{ - int fds[2] = { 0 }; - pid_t pid = -1; - - if (pipe(fds) == -1) - error_exit(TRUE, TRUE, "error creating pipe\n"); - - pid = fork(); - if (pid == -1) - error_exit(TRUE, TRUE, "error forking\n"); - - if (pid == 0) - { - int loop; - - for(loop=0; loop<1024; loop++) - { - if (fds[0] != loop) - close(loop); - } - - signal(SIGHUP, SIG_DFL); - - if (dup(fds[0]) == -1) - error_exit(TRUE, TRUE, "dup() failed\n"); - - setsid(); -#ifndef __minix - setpgid(0, 0); -#endif - - if (execl(xclip, xclip, NULL) == -1) - error_exit(TRUE, FALSE, "execl of %s failed\n", xclip); - - exit(1); - } - - WRITE(fds[1], what, strlen(what), "xclip"); - - close(fds[1]); - close(fds[0]); -} - -void send_to_clipboard(buffer *pb) -{ - if (file_exist(xclip) == -1) - error_popup("Copy to clipboard", -1, "xclip program not found"); - else if (getenv("DISPLAY") == NULL) - error_popup("Copy to clipboard", -1, "DISPLAY environment variable not set"); - else - { - char *data = NULL; - int len_out = 0; - int loop = 0; - NEWWIN *mywin = create_popup(9, 40); - - win_header(mywin, "Copy buffer to X clipboard"); - mydoupdate(); - - for(loop=0; loop<pb -> curpos; loop++) - { - int len = 0; - - if ((pb -> be)[loop].Bline == NULL) - continue; - - len = strlen((pb -> be)[loop].Bline); - - data = (char *)realloc(data, len_out + len + 1); - - memcpy(&data[len_out], (pb -> be)[loop].Bline, len + 1); - - len_out += len; - } - - send_to_xclip(data); - - free(data); - - mvwprintw(mywin -> win, 3, 2, "Finished!"); - mvwprintw(mywin -> win, 4, 2, "Press any key to continue..."); - mydoupdate(); - - (void)wait_for_keypress(-1, 0, mywin, 0); - - delete_popup(mywin); - } -} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/multitail-6.4.2/xclip.h new/multitail-6.5.0/xclip.h --- old/multitail-6.4.2/xclip.h 2014-05-01 14:54:06.000000000 +0200 +++ new/multitail-6.5.0/xclip.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,4 +0,0 @@ -extern char *xclip; - -void send_to_xclip(char *what); -void send_to_clipboard(buffer *pb);