From e48e6cda6a93b5c7438b9f40c0e536bed75c2d40 Mon Sep 17 00:00:00 2001 From: fbrosson Date: Wed, 16 May 2018 18:39:02 +0000 Subject: [PATCH] less: shrink patchset by dropping white space changes. --- sys-apps/less/patches/less-530.patchset | 634 +----------------------- 1 file changed, 8 insertions(+), 626 deletions(-) diff --git a/sys-apps/less/patches/less-530.patchset b/sys-apps/less/patches/less-530.patchset index e48ceda6c..a6022d1b3 100644 --- a/sys-apps/less/patches/less-530.patchset +++ b/sys-apps/less/patches/less-530.patchset @@ -5,185 +5,10 @@ Subject: import fix from previous version diff --git a/cmdbuf.c b/cmdbuf.c -index db5b259..671403a 100644 +index db5b259..d111ef6 100644 --- a/cmdbuf.c +++ b/cmdbuf.c -@@ -74,16 +74,16 @@ struct mlist - /* - * These are the various command histories that exist. - */ --struct mlist mlist_search = -+struct mlist mlist_search = - { &mlist_search, &mlist_search, &mlist_search, NULL, 0 }; - public void *ml_search = (void *) &mlist_search; - --struct mlist mlist_examine = -+struct mlist mlist_examine = - { &mlist_examine, &mlist_examine, &mlist_examine, NULL, 0 }; - public void *ml_examine = (void *) &mlist_examine; - - #if SHELL_ESCAPE || PIPEC --struct mlist mlist_shell = -+struct mlist mlist_shell = - { &mlist_shell, &mlist_shell, &mlist_shell, NULL, 0 }; - public void *ml_shell = (void *) &mlist_shell; - #endif -@@ -394,7 +394,7 @@ cmd_right() - char *pr; - char *ncp; - int width; -- -+ - if (*cp == '\0') - { - /* Already at the end of the line. */ -@@ -460,14 +460,14 @@ cmd_ichar(cs, clen) - int clen; - { - char *s; -- -+ - if (strlen(cmdbuf) + clen >= sizeof(cmdbuf)-1) - { - /* No room in the command buffer for another char. */ - bell(); - return (CC_ERROR); - } -- -+ - /* - * Make room for the new character (shift the tail of the buffer right). - */ -@@ -527,7 +527,7 @@ cmd_erase() - */ - updown_match = -1; - cmd_repaint(cp); -- -+ - /* - * We say that erasing the entire command string causes us - * to abort the current command, if CF_QUIT_ON_ERASE is set. -@@ -664,7 +664,7 @@ cmd_updown(action) - { - constant char *s; - struct mlist *ml; -- -+ - if (curr_mlist == NULL) - { - /* -@@ -729,7 +729,7 @@ cmd_addhist(mlist, cmd, modified) - { - #if CMD_HISTORY - struct mlist *ml; -- -+ - /* - * Don't save a trivial command. - */ -@@ -801,7 +801,7 @@ cmd_edit(c) - #else - #define not_in_completion() - #endif -- -+ - /* - * See if the char is indeed a line-editing command. - */ -@@ -912,7 +912,7 @@ cmd_istr(str) - char *s; - int action; - char *endline = str + strlen(str); -- -+ - for (s = str; *s != '\0'; ) - { - char *os = s; -@@ -944,7 +944,7 @@ delimit_word() - constant char *esc = get_meta_escape(); - int esclen = (int) strlen(esc); - #endif -- -+ - /* - * Move cursor to end of word. - */ -@@ -1017,7 +1017,7 @@ delimit_word() - - /* - * Set things up to enter completion mode. -- * Expand the word under the cursor into a list of filenames -+ * Expand the word under the cursor into a list of filenames - * which start with that word, and set tk_text to that list. - */ - static void -@@ -1025,7 +1025,7 @@ init_compl() - { - char *word; - char c; -- -+ - /* - * Get rid of any previous tk_text. - */ -@@ -1114,8 +1114,8 @@ cmd_complete(action) - if (!in_completion || action == EC_EXPAND) - { - /* -- * Expand the word under the cursor and -- * use the first word in the expansion -+ * Expand the word under the cursor and -+ * use the first word in the expansion - * (or the entire expansion if we're doing EC_EXPAND). - */ - init_compl(); -@@ -1147,13 +1147,13 @@ cmd_complete(action) - */ - tk_trial = next_compl(action, tk_trial); - } -- -+ - /* - * Remove the original word, or the previous trial completion. - */ - while (cp > tk_ipoint) - (void) cmd_erase(); -- -+ - if (tk_trial == NULL) - { - /* -@@ -1184,9 +1184,9 @@ cmd_complete(action) - goto fail; - } - } -- -+ - return (CC_OK); -- -+ - fail: - in_completion = 0; - bell(); -@@ -1274,7 +1274,7 @@ cmd_char(c) - literal = 0; - return (cmd_ichar(cmd_mbc_buf, len)); - } -- -+ - /* - * See if it is a line-editing character. - */ -@@ -1290,7 +1290,7 @@ cmd_char(c) - break; - } - } -- -+ - /* - * Insert the char into the command buffer. - */ -@@ -1360,10 +1360,14 @@ mlist_size(ml) +@@ -1360,7 +1360,11 @@ mlist_size(ml) static char * histfile_name() { @@ -194,11 +19,7 @@ index db5b259..671403a 100644 +#endif char *name; int len; -- -+ - /* See if filename is explicitly specified by $LESSHISTFILE. */ - name = lgetenv("LESSHISTFILE"); - if (name != NULL && *name != '\0') + @@ -1378,6 +1382,13 @@ histfile_name() if (strcmp(LESSHISTFILE, "") == 0 || strcmp(LESSHISTFILE, "-") == 0) return (NULL); @@ -222,137 +43,10 @@ index db5b259..671403a 100644 name = (char *) ecalloc(len, sizeof(char)); SNPRINTF2(name, len, "%s/%s", home, LESSHISTFILE); diff --git a/configure.ac b/configure.ac -index 3616ef0..144a8be 100644 +index 3616ef0..40526ff 100644 --- a/configure.ac +++ b/configure.ac -@@ -5,7 +5,7 @@ - # You may distribute under the terms of either the GNU General Public - # License or the Less License, as specified in the README file. - # --# For more information about less, or for information on how to -+# For more information about less, or for information on how to - # contact the author, see the README file. - - # Autoconf initialization. -@@ -237,10 +237,10 @@ AH_TEMPLATE([SECURE_COMPILE], - # Checks for identifiers. - AC_TYPE_OFF_T - AC_MSG_CHECKING(for void) --AC_TRY_COMPILE(, [void *foo = 0;], -+AC_TRY_COMPILE(, [void *foo = 0;], - [AC_MSG_RESULT(yes); AC_DEFINE(HAVE_VOID)], [AC_MSG_RESULT(no)]) - AC_MSG_CHECKING(for const) --AC_TRY_COMPILE(, [const int foo = 0;], -+AC_TRY_COMPILE(, [const int foo = 0;], - [AC_MSG_RESULT(yes); AC_DEFINE(HAVE_CONST)], [AC_MSG_RESULT(no)]) - AC_MSG_CHECKING(for time_t) - AC_TRY_COMPILE([#include ], [time_t t = 0;], -@@ -306,7 +306,7 @@ AC_TRY_LINK([ - [AC_MSG_RESULT(yes); AC_DEFINE(HAVE_STRERROR)], [AC_MSG_RESULT(no)]) - - AC_MSG_CHECKING(for sys_errlist) --AC_TRY_LINK(, [extern char *sys_errlist[]; static char **x; x = sys_errlist;], -+AC_TRY_LINK(, [extern char *sys_errlist[]; static char **x; x = sys_errlist;], - [AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYS_ERRLIST)], [AC_MSG_RESULT(no)]) - - AC_CHECK_TYPES([sigset_t],,,[#include ]) -@@ -322,13 +322,13 @@ AC_MSG_CHECKING(for errno) - AC_TRY_LINK([ - #if HAVE_ERRNO_H - #include --#endif], [static int x; x = errno;], -+#endif], [static int x; x = errno;], - [AC_MSG_RESULT(yes - in errno.h); AC_DEFINE(HAVE_ERRNO) have_errno=yes]) - if test $have_errno = no; then - AC_TRY_LINK([ - #if HAVE_ERRNO_H - #include --#endif], [extern int errno; static int x; x = errno;], -+#endif], [extern int errno; static int x; x = errno;], - [AC_MSG_RESULT(yes - must define); AC_DEFINE(HAVE_ERRNO) AC_DEFINE(MUST_DEFINE_ERRNO)], - [AC_MSG_RESULT(no)]) - fi -@@ -363,7 +363,7 @@ AC_TRY_LINK([ - #endif], [ospeed = 0;], - [AC_MSG_RESULT(yes - in termcap.h); AC_DEFINE(HAVE_OSPEED) have_ospeed=yes]) - if test $have_ospeed = no; then --AC_TRY_LINK(, [extern short ospeed; ospeed = 0;], -+AC_TRY_LINK(, [extern short ospeed; ospeed = 0;], - [AC_MSG_RESULT(yes - must define); AC_DEFINE(HAVE_OSPEED) AC_DEFINE(MUST_DEFINE_OSPEED)], - [AC_MSG_RESULT(no)]) - fi -@@ -379,7 +379,7 @@ AC_ARG_WITH(no-float, - [ --with-no-float Do not use floating point], - WANT_NO_FLOAT=1, WANT_NO_FLOAT=0) - if test $WANT_NO_FLOAT = 0; then -- AC_TRY_LINK(, [double f1 = 12.5; double f2 = f1*f1/2.5;], -+ AC_TRY_LINK(, [double f1 = 12.5; double f2 = f1*f1/2.5;], - [AC_MSG_RESULT(yes); AC_DEFINE(HAVE_FLOAT)], [AC_MSG_RESULT(no)]) - else - AC_MSG_RESULT(disabled by user) -@@ -433,21 +433,21 @@ fi - - if test $have_regex = no; then - if test $WANT_REGEX = auto -o $WANT_REGEX = pcre; then --AC_CHECK_LIB(pcre, pcre_compile, -+AC_CHECK_LIB(pcre, pcre_compile, - [AC_DEFINE(HAVE_PCRE) LIBS="$LIBS -lpcre" have_regex=yes; supported_regex="$supported_regex pcre"], []) - fi - fi - - if test $have_regex = no; then - if test $WANT_REGEX = auto -o $WANT_REGEX = gnu; then --AC_CHECK_LIB(c, re_compile_pattern, -+AC_CHECK_LIB(c, re_compile_pattern, - [AC_DEFINE(HAVE_GNU_REGEX) have_regex=yes; supported_regex="$supported_regex gnu"], []) - fi - fi - - if test $have_regex = no; then - if test $WANT_REGEX = auto -o $WANT_REGEX = regcmp; then --AC_CHECK_FUNC(regcmp, -+AC_CHECK_FUNC(regcmp, - [AC_DEFINE(HAVE_REGCMP) have_regex=yes; supported_regex="$supported_regex regcmp"],[]) - fi - fi -@@ -463,7 +463,7 @@ fi - - if test $have_regex = no && test -f ${srcdir}/regexp.c; then - if test $WANT_REGEX = auto -o $WANT_REGEX = regcomp-local; then --AC_MSG_RESULT(using V8 regcomp -- local source); AC_DEFINE(HAVE_V8_REGCOMP) -+AC_MSG_RESULT(using V8 regcomp -- local source); AC_DEFINE(HAVE_V8_REGCOMP) - supported_regex="$supported_regex regcomp-local" - AC_DEFINE(HAVE_REGEXEC2) REGEX_O='regexp.$(O)' AC_SUBST(REGEX_O) have_regex=yes - fi -@@ -538,7 +538,7 @@ AH_TOP([ - #define CMD_HISTORY 1 - - /* -- * HILITE_SEARCH is 1 if you wish to have search targets to be -+ * HILITE_SEARCH is 1 if you wish to have search targets to be - * displayed in standout mode. - */ - #define HILITE_SEARCH 1 -@@ -556,7 +556,7 @@ AH_TOP([ - #define TAGS (!SECURE) - - /* -- * USERFILE is 1 if you wish to allow a .less file to specify -+ * USERFILE is 1 if you wish to allow a .less file to specify - * user-defined key bindings. - */ - #define USERFILE (!SECURE) -@@ -593,19 +593,25 @@ AH_TOP([ - #define ONLY_RETURN 0 - - /* -- * LESSKEYFILE is the filename of the default lesskey output file -+ * LESSKEYFILE is the filename of the default lesskey output file - * (in the HOME directory). - * LESSKEYFILE_SYS is the filename of the system-wide lesskey output file. -- * DEF_LESSKEYINFILE is the filename of the default lesskey input -+ * DEF_LESSKEYINFILE is the filename of the default lesskey input - * (in the HOME directory). +@@ -601,11 +601,17 @@ AH_TOP([ * LESSHISTFILE is the filename of the history file * (in the HOME directory). */ @@ -371,28 +65,10 @@ index 3616ef0..144a8be 100644 /* Settings always true on Unix. */ -@@ -662,7 +668,7 @@ AH_TOP([ - #define DEF_METACHARS "; *?\t\n'\"()<>[]|&^`#\\$%=~{}," - #define DEF_METAESCAPE "\\" - --/* -+/* - * HAVE_DUP is 1 if your system has the dup() call. - */ - #define HAVE_DUP 1 diff --git a/filename.c b/filename.c -index 983a02b..0343df1 100644 +index 983a02b..e6002c2 100644 --- a/filename.c +++ b/filename.c -@@ -164,7 +164,7 @@ shell_quote(s) - if (esclen == 0) - { - /* -- * We've got a metachar, but this shell -+ * We've got a metachar, but this shell - * doesn't support escape chars. Use quotes. - */ - use_quotes = 1; @@ -259,12 +259,23 @@ homefile(filename) { char *pathname; @@ -417,136 +93,8 @@ index 983a02b..0343df1 100644 #if OS2 /* * Try $INIT/filename. -@@ -317,7 +328,7 @@ fexpand(s) - (c) == '#' ? old_ifile : NULL_IFILE) - - /* -- * Make one pass to see how big a buffer we -+ * Make one pass to see how big a buffer we - * need to allocate for the expanded string. - */ - n = 0; -@@ -415,8 +426,8 @@ fcomplete(s) - /* - * But in DOS, we have to glob "s*.*". - * But if the final component of the filename already has -- * a dot in it, just do "s*". -- * (Thus, "FILE" is globbed as "FILE*.*", -+ * a dot in it, just do "s*". -+ * (Thus, "FILE" is globbed as "FILE*.*", - * but "FILE.A" is globbed as "FILE.A*"). - */ - { -@@ -526,8 +537,8 @@ readfd(fd) - int ch; - char *buf; - char *p; -- -- /* -+ -+ /* - * Make a guess about how many chars in the string - * and allocate a buffer to hold it. - */ -@@ -583,7 +594,7 @@ shellcmd(cmd) - char *esccmd; - - /* -- * Read the output of <$SHELL -c cmd>. -+ * Read the output of <$SHELL -c cmd>. - * Escape any metacharacters in the command. - */ - esccmd = shell_quote(cmd); -@@ -684,7 +695,7 @@ lglob(filename) - char *pfilename; - char *qfilename; - DECL_GLOB_NAME(fnd,drive,dir,fname,ext,handle) -- -+ - GLOB_FIRST_NAME(filename, &fnd, handle); - if (GLOB_FIRST_FAILED(handle)) - { -@@ -823,7 +834,7 @@ num_pct_s(lessopen) - } - - /* -- * See if we should open a "replacement file" -+ * See if we should open a "replacement file" - * instead of the file we're about to open. - */ - public char * -@@ -843,7 +854,7 @@ open_altfile(filename, pf, pfd) - #if HAVE_FILENO - int returnfd = 0; - #endif -- -+ - if (!use_lessopen || secure) - return (NULL); - ch_ungetchar(-1); -@@ -852,7 +863,7 @@ open_altfile(filename, pf, pfd) - while (*lessopen == '|') - { - /* -- * If LESSOPEN starts with a |, it indicates -+ * If LESSOPEN starts with a |, it indicates - * a "pipe preprocessor". - */ - #if !HAVE_FILENO -@@ -912,7 +923,7 @@ open_altfile(filename, pf, pfd) - /* - * Pipe is empty. - * If more than 1 pipe char was specified, -- * the exit status tells whether the file itself -+ * the exit status tells whether the file itself - * is empty, or if there is no alt file. - * If only one pipe char, just assume no alt file. - */ -@@ -954,13 +965,13 @@ close_altfile(altfilename, filename) - FILE *fd; - char *cmd; - int len; -- -+ - if (secure) - return; - ch_ungetchar(-1); - if ((lessclose = lgetenv("LESSCLOSE")) == NULL) - return; -- if (num_pct_s(lessclose) > 2) -+ if (num_pct_s(lessclose) > 2) - { - error("LESSCLOSE ignored; must contain no more than 2 %%s", NULL_PARG); - return; -@@ -974,7 +985,7 @@ close_altfile(altfilename, filename) - pclose(fd); - #endif - } -- -+ - /* - * Is the specified file a directory? - */ -@@ -1022,7 +1033,7 @@ bad_file(filename) - { - static char is_a_dir[] = " is a directory"; - -- m = (char *) ecalloc(strlen(filename) + sizeof(is_a_dir), -+ m = (char *) ecalloc(strlen(filename) + sizeof(is_a_dir), - sizeof(char)); - strcpy(m, filename); - strcat(m, is_a_dir); -@@ -1077,7 +1088,7 @@ filesize(f) - } - - /* -- * -+ * - */ - public char * - shell_coption() diff --git a/less.h b/less.h -index 39ca65e..203d620 100644 +index 39ca65e..8be9a49 100644 --- a/less.h +++ b/less.h @@ -100,6 +100,11 @@ @@ -561,131 +109,10 @@ index 39ca65e..203d620 100644 #if MSDOS_COMPILER==WIN32C || OS2 #include #endif -@@ -305,7 +310,7 @@ struct scrpos - /* - * A mark is an ifile (input file) plus a position within the file. - */ --struct mark -+struct mark - { - IFILE m_ifile; - struct scrpos m_scrpos; -@@ -331,7 +336,7 @@ struct wchar_range - LWCHAR first, last; - }; - --struct wchar_range_table -+struct wchar_range_table - { - struct wchar_range *table; - int count; diff --git a/lesskey.c b/lesskey.c -index fa1ab6d..5fa3735 100644 +index fa1ab6d..a1d39e7 100644 --- a/lesskey.c +++ b/lesskey.c -@@ -11,7 +11,7 @@ - /* - * lesskey [-o output] [input] - * -- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * - * Make a .less file. - * If no input file is specified, standard input is used. -@@ -21,9 +21,9 @@ - * key bindings. Basically any sequence of 1 to MAX_CMDLEN - * keystrokes may be bound to an existing less function. - * -- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * -- * The input file is an ascii file consisting of a -+ * The input file is an ascii file consisting of a - * sequence of lines of the form: - * string action [chars] - * -@@ -37,14 +37,14 @@ - * to specify a character by its octal value. - * 4. A backslash followed by b, e, n, r or t - * to specify \b, ESC, \n, \r or \t, respectively. -- * 5. Any character (other than those mentioned above) preceded -+ * 5. Any character (other than those mentioned above) preceded - * by a \ to specify the character itself (characters which - * must be preceded by \ include ^, \, and whitespace. - * "action" is the name of a "less" action, from the table below. - * "chars" is an optional sequence of characters which is treated - * as keyboard input after the command is executed. - * -- * Blank lines and lines which start with # are ignored, -+ * Blank lines and lines which start with # are ignored, - * except for the special control lines: - * #command Signals the beginning of the command - * keys section. -@@ -55,7 +55,7 @@ - * #stop Stops command parsing in less; - * causes all default keys to be disabled. - * -- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * - * The output file is a non-ascii file, consisting of a header, - * one or more sections, and a trailer. -@@ -63,7 +63,7 @@ - * and the section data. Normally there are three sections: - * CMD_SECTION Definition of command keys. - * EDIT_SECTION Definition of editing keys. -- * END_SECTION A special section header, with no -+ * END_SECTION A special section header, with no - * length word or section data. - * - * Section data consists of zero or more byte sequences of the form: -@@ -77,7 +77,7 @@ - * If action is ORed with A_EXTRA, the action byte is followed - * by the null-terminated "chars" string. - * -- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - */ - - #include "less.h" -@@ -90,7 +90,7 @@ struct cmdname - int cn_action; - }; - --struct cmdname cmdnames[] = -+struct cmdname cmdnames[] = - { - { "back-bracket", A_B_BRACKET }, - { "back-line", A_B_LINE }, -@@ -158,7 +158,7 @@ struct cmdname cmdnames[] = - { NULL, 0 } - }; - --struct cmdname editnames[] = -+struct cmdname editnames[] = - { - { "back-complete", EC_B_COMPLETE }, - { "backspace", EC_BACKSPACE }, -@@ -196,14 +196,14 @@ struct table vartable; - struct table *currtable = &cmdtable; - - char fileheader[] = { -- C0_LESSKEY_MAGIC, -- C1_LESSKEY_MAGIC, -- C2_LESSKEY_MAGIC, -+ C0_LESSKEY_MAGIC, -+ C1_LESSKEY_MAGIC, -+ C2_LESSKEY_MAGIC, - C3_LESSKEY_MAGIC - }; - char filetrailer[] = { -- C0_END_LESSKEY_MAGIC, -- C1_END_LESSKEY_MAGIC, -+ C0_END_LESSKEY_MAGIC, -+ C1_END_LESSKEY_MAGIC, - C2_END_LESSKEY_MAGIC - }; - char cmdsection[1] = { CMD_SECTION }; @@ -250,8 +250,19 @@ homefile(filename) char *p; char *pathname; @@ -706,51 +133,6 @@ index fa1ab6d..5fa3735 100644 #if OS2 else if ((p = getenv("INIT")) != NULL && *p != '\0') pathname = mkpathname(p, filename); -@@ -442,7 +453,7 @@ tstr(pp, xlate) - /* FALLTHRU */ - default: - /* -- * Backslash followed by any other char -+ * Backslash followed by any other char - * just means that char. - */ - *pp = p+1; -@@ -478,7 +489,7 @@ tstr(pp, xlate) - skipsp(s) - char *s; - { -- while (*s == ' ' || *s == '\t') -+ while (*s == ' ' || *s == '\t') - s++; - return (s); - } -@@ -600,7 +611,7 @@ fputint(fd, val) - - if (val >= KRADIX*KRADIX) - { -- fprintf(stderr, "error: integer too big (%d > %d)\n", -+ fprintf(stderr, "error: integer too big (%d > %d)\n", - val, KRADIX*KRADIX); - exit(1); - } -@@ -790,7 +801,7 @@ main(argc, argv) - char *path = getenv("HOMEPATH"); - if (drive != NULL && path != NULL) - { -- char *env = (char *) calloc(strlen(drive) + -+ char *env = (char *) calloc(strlen(drive) + - strlen(path) + 6, sizeof(char)); - strcpy(env, "HOME="); - strcat(env, drive); -@@ -869,7 +880,7 @@ main(argc, argv) - fputbytes(out, (char *)edittable.buffer, edittable.pbuffer-edittable.buffer); - - /* Environment variable section */ -- fputbytes(out, varsection, sizeof(varsection)); -+ fputbytes(out, varsection, sizeof(varsection)); - fputint(out, vartable.pbuffer - vartable.buffer); - fputbytes(out, (char *)vartable.buffer, vartable.pbuffer-vartable.buffer); - -- 2.14.2