diff --git a/sys-apps/less/less-493.recipe b/sys-apps/less/less-520.recipe similarity index 94% rename from sys-apps/less/less-493.recipe rename to sys-apps/less/less-520.recipe index f8805de60..c7bf84e95 100644 --- a/sys-apps/less/less-493.recipe +++ b/sys-apps/less/less-520.recipe @@ -10,7 +10,7 @@ COPYRIGHT="1984-2015 Mark Nudelman" LICENSE="GNU GPL v3" REVISION="1" SOURCE_URI="http://www.greenwoodsoftware.com/less/less-$portVersion.tar.gz" -CHECKSUM_SHA256="8b818f58ebf90f566e3c6be6c06209e245c9018c754d0d338bb925ea2f240d73" +CHECKSUM_SHA256="7b89ea8e605c242f792594ca81dc89979f3537d8cce578f628329c748004908b" PATCHES="less-$portVersion.patchset" ADDITIONAL_FILES="sysless.in" diff --git a/sys-apps/less/patches/less-493.patchset b/sys-apps/less/patches/less-520.patchset similarity index 80% rename from sys-apps/less/patches/less-493.patchset rename to sys-apps/less/patches/less-520.patchset index d3eb011d6..626000529 100644 --- a/sys-apps/less/patches/less-493.patchset +++ b/sys-apps/less/patches/less-520.patchset @@ -1,29 +1,29 @@ -From 472def0946da114d06dd847ea7e3b88aeeb0ed07 Mon Sep 17 00:00:00 2001 +From 4ac7dd380f1bb5eac3def440024ffb74dc75cc6d Mon Sep 17 00:00:00 2001 From: Jerome Duval Date: Thu, 29 Jun 2017 17:06:55 +0200 Subject: import fix from previous version diff --git a/cmdbuf.c b/cmdbuf.c -index 3df0bac..e757b1e 100644 +index db5b259..671403a 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 = +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 = +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 = +struct mlist mlist_shell = { &mlist_shell, &mlist_shell, &mlist_shell, NULL, 0 }; public void *ml_shell = (void *) &mlist_shell; @@ -32,25 +32,16 @@ index 3df0bac..e757b1e 100644 char *pr; char *ncp; int width; -- +- + if (*cp == '\0') { /* Already at the end of the line. */ -@@ -428,7 +428,7 @@ cmd_left() - { - char *ncp; - int width, bswidth; -- -+ - if (cp <= cmdbuf) - { - /* Already at the beginning of the line */ -@@ -459,14 +459,14 @@ cmd_ichar(cs, clen) +@@ -460,14 +460,14 @@ cmd_ichar(cs, clen) int clen; { char *s; -- +- + if (strlen(cmdbuf) + clen >= sizeof(cmdbuf)-1) { @@ -58,141 +49,141 @@ index 3df0bac..e757b1e 100644 bell(); return (CC_ERROR); } -- +- + /* * Make room for the new character (shift the tail of the buffer right). */ -@@ -526,7 +526,7 @@ cmd_erase() +@@ -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. -@@ -663,7 +663,7 @@ cmd_updown(action) +@@ -664,7 +664,7 @@ cmd_updown(action) { constant char *s; struct mlist *ml; -- +- + if (curr_mlist == NULL) { /* -@@ -728,7 +728,7 @@ cmd_addhist(mlist, cmd, modified) +@@ -729,7 +729,7 @@ cmd_addhist(mlist, cmd, modified) { #if CMD_HISTORY struct mlist *ml; -- +- + /* * Don't save a trivial command. */ -@@ -800,7 +800,7 @@ cmd_edit(c) +@@ -801,7 +801,7 @@ cmd_edit(c) #else #define not_in_completion() #endif -- +- + /* * See if the char is indeed a line-editing command. */ -@@ -911,7 +911,7 @@ cmd_istr(str) +@@ -912,7 +912,7 @@ cmd_istr(str) char *s; int action; char *endline = str + strlen(str); -- +- + for (s = str; *s != '\0'; ) { char *os = s; -@@ -943,7 +943,7 @@ delimit_word() +@@ -944,7 +944,7 @@ delimit_word() constant char *esc = get_meta_escape(); int esclen = (int) strlen(esc); #endif -- +- + /* * Move cursor to end of word. */ -@@ -1016,7 +1016,7 @@ delimit_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 + * 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 -@@ -1024,7 +1024,7 @@ init_compl() +@@ -1025,7 +1025,7 @@ init_compl() { char *word; char c; -- +- + /* * Get rid of any previous tk_text. */ -@@ -1113,8 +1113,8 @@ cmd_complete(action) +@@ -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 + * 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(); -@@ -1146,13 +1146,13 @@ cmd_complete(action) +@@ -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) { /* -@@ -1183,9 +1183,9 @@ cmd_complete(action) +@@ -1184,9 +1184,9 @@ cmd_complete(action) goto fail; } } -- +- + return (CC_OK); -- +- + fail: in_completion = 0; bell(); -@@ -1266,7 +1266,7 @@ cmd_char(c) +@@ -1274,7 +1274,7 @@ cmd_char(c) literal = 0; return (cmd_ichar(cmd_mbc_buf, len)); } -- +- + /* * See if it is a line-editing character. */ -@@ -1282,7 +1282,7 @@ cmd_char(c) +@@ -1290,7 +1290,7 @@ cmd_char(c) break; } } -- +- + /* * Insert the char into the command buffer. */ -@@ -1352,10 +1352,14 @@ mlist_size(ml) +@@ -1360,10 +1360,14 @@ mlist_size(ml) static char * histfile_name() { @@ -203,15 +194,15 @@ index 3df0bac..e757b1e 100644 +#endif char *name; int len; -- +- + /* See if filename is explicitly specified by $LESSHISTFILE. */ name = lgetenv("LESSHISTFILE"); if (name != NULL && *name != '\0') -@@ -1370,6 +1374,13 @@ histfile_name() +@@ -1378,6 +1382,13 @@ histfile_name() if (strcmp(LESSHISTFILE, "") == 0 || strcmp(LESSHISTFILE, "-") == 0) return (NULL); - + +#ifdef __HAIKU__ + { + dev_t volume = dev_for_path("/boot"); @@ -222,7 +213,7 @@ index 3df0bac..e757b1e 100644 /* Otherwise, file is in $HOME. */ home = lgetenv("HOME"); if (home == NULL || *home == '\0') -@@ -1380,6 +1391,7 @@ histfile_name() +@@ -1388,6 +1399,7 @@ histfile_name() #endif return (NULL); } @@ -231,52 +222,52 @@ index 3df0bac..e757b1e 100644 name = (char *) ecalloc(len, sizeof(char)); SNPRINTF2(name, len, "%s/%s", home, LESSHISTFILE); diff --git a/configure.ac b/configure.ac -index 383f840..8bf3e39 100644 +index 3616ef0..144a8be 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 +# 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_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_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_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;], +#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;], +#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)]) @@ -285,7 +276,7 @@ index 383f840..8bf3e39 100644 #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_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)]) @@ -294,72 +285,72 @@ index 383f840..8bf3e39 100644 [ --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_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_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_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_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) +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 + * 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 + * 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 + * 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 + * DEF_LESSKEYINFILE is the filename of the default lesskey input * (in the HOME directory). * LESSHISTFILE is the filename of the history file @@ -377,35 +368,35 @@ index 383f840..8bf3e39 100644 #define LESSHISTFILE ".lesshst" - +#endif - + /* Settings always true on Unix. */ - + @@ -662,7 +668,7 @@ AH_TOP([ - #define DEF_METACHARS "; *?\t\n'\"()<>[]|&^`#\\$%=~" + #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 a153207..8a32d6b 100644 +index 1c0ae42..b9d322a 100644 --- a/filename.c +++ b/filename.c -@@ -168,7 +168,7 @@ shell_quote(s) +@@ -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 + * We've got a metachar, but this shell * doesn't support escape chars. Use quotes. */ use_quotes = 1; -@@ -266,12 +266,23 @@ homefile(filename) +@@ -259,12 +259,23 @@ homefile(filename) { char *pathname; - + +#ifdef __HAIKU__ + char path[B_PATH_NAME_LENGTH+B_FILE_NAME_LENGTH]; + dev_t volume = dev_for_path("/boot"); @@ -426,144 +417,142 @@ index a153207..8a32d6b 100644 #if OS2 /* * Try $INIT/filename. -@@ -324,7 +335,7 @@ fexpand(s) +@@ -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 + * Make one pass to see how big a buffer we * need to allocate for the expanded string. */ n = 0; -@@ -422,8 +433,8 @@ fcomplete(s) +@@ -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*.*", + * a dot in it, just do "s*". + * (Thus, "FILE" is globbed as "FILE*.*", * but "FILE.A" is globbed as "FILE.A*"). */ { -@@ -535,8 +546,8 @@ readfd(fd) +@@ -528,8 +539,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. */ -@@ -592,7 +603,7 @@ shellcmd(cmd) +@@ -585,7 +596,7 @@ shellcmd(cmd) char *esccmd; - + /* -- * Read the output of <$SHELL -c cmd>. +- * Read the output of <$SHELL -c cmd>. + * Read the output of <$SHELL -c cmd>. * Escape any metacharacters in the command. */ esccmd = shell_quote(cmd); -@@ -696,7 +707,7 @@ lglob(filename) - char *pathname; - char *qpathname; +@@ -686,7 +697,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)) { -@@ -840,7 +851,7 @@ num_pct_s(lessopen) +@@ -825,7 +836,7 @@ num_pct_s(lessopen) } - + /* -- * See if we should open a "replacement file" +- * 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 * -@@ -859,7 +870,7 @@ open_altfile(filename, pf, pfd) +@@ -845,7 +856,7 @@ open_altfile(filename, pf, pfd) #if HAVE_FILENO int returnfd = 0; #endif -- +- + if (!use_lessopen || secure) return (NULL); ch_ungetchar(-1); -@@ -868,7 +879,7 @@ open_altfile(filename, pf, pfd) +@@ -854,7 +865,7 @@ open_altfile(filename, pf, pfd) while (*lessopen == '|') { /* -- * If LESSOPEN starts with a |, it indicates +- * If LESSOPEN starts with a |, it indicates + * If LESSOPEN starts with a |, it indicates * a "pipe preprocessor". */ #if !HAVE_FILENO -@@ -923,7 +934,7 @@ open_altfile(filename, pf, pfd) +@@ -914,7 +925,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 + * 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. */ -@@ -966,7 +977,7 @@ close_altfile(altfilename, filename, pipefd) +@@ -956,13 +967,13 @@ close_altfile(altfilename, filename) FILE *fd; char *cmd; int len; -- +- + if (secure) return; - if (pipefd != NULL) -@@ -982,7 +993,7 @@ close_altfile(altfilename, filename, pipefd) - } + ch_ungetchar(-1); if ((lessclose = lgetenv("LESSCLOSE")) == NULL) return; -- if (num_pct_s(lessclose) > 2) +- if (num_pct_s(lessclose) > 2) + if (num_pct_s(lessclose) > 2) { - error("Invalid LESSCLOSE variable", NULL_PARG); + error("LESSCLOSE ignored; must contain no more than 2 %%s", NULL_PARG); return; -@@ -996,7 +1007,7 @@ close_altfile(altfilename, filename, pipefd) +@@ -976,7 +987,7 @@ close_altfile(altfilename, filename) pclose(fd); #endif } -- +- + /* * Is the specified file a directory? */ -@@ -1047,7 +1058,7 @@ bad_file(filename) +@@ -1024,7 +1035,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), + m = (char *) ecalloc(strlen(filename) + sizeof(is_a_dir), sizeof(char)); strcpy(m, filename); strcat(m, is_a_dir); -@@ -1103,7 +1114,7 @@ filesize(f) +@@ -1079,7 +1090,7 @@ filesize(f) } - + /* -- * +- * + * */ public char * shell_coption() diff --git a/less.h b/less.h -index 69576bb..de486a0 100644 +index 39ca65e..203d620 100644 --- a/less.h +++ b/less.h @@ -100,6 +100,11 @@ #include #endif - + +#ifdef __HAIKU__ +#include +#include @@ -576,7 +565,7 @@ index 69576bb..de486a0 100644 /* * A mark is an ifile (input file) plus a position within the file. */ --struct mark +-struct mark +struct mark { IFILE m_ifile; @@ -584,21 +573,21 @@ index 69576bb..de486a0 100644 @@ -331,7 +336,7 @@ struct wchar_range LWCHAR first, last; }; - --struct wchar_range_table + +-struct wchar_range_table +struct wchar_range_table { struct wchar_range *table; int count; diff --git a/lesskey.c b/lesskey.c -index 686f6e4..8a8dc7e 100644 +index 9fd0a9f..f7b065b 100644 --- a/lesskey.c +++ b/lesskey.c @@ -11,7 +11,7 @@ /* * lesskey [-o output] [input] * -- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Make a .less file. @@ -607,10 +596,10 @@ index 686f6e4..8a8dc7e 100644 * 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 + * The input file is an ascii file consisting of a * sequence of lines of the form: * string action [chars] @@ -619,7 +608,7 @@ index 686f6e4..8a8dc7e 100644 * 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 + * 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. @@ -627,7 +616,7 @@ index 686f6e4..8a8dc7e 100644 * "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, + * Blank lines and lines which start with # are ignored, * except for the special control lines: * #command Signals the beginning of the command @@ -636,7 +625,7 @@ index 686f6e4..8a8dc7e 100644 * #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, @@ -645,7 +634,7 @@ index 686f6e4..8a8dc7e 100644 * 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 + * END_SECTION A special section header, with no * length word or section data. * @@ -654,53 +643,53 @@ index 686f6e4..8a8dc7e 100644 * 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[] = +struct cmdname cmdnames[] = { { "back-bracket", A_B_BRACKET }, { "back-line", A_B_LINE }, -@@ -156,7 +156,7 @@ struct cmdname cmdnames[] = +@@ -158,7 +158,7 @@ struct cmdname cmdnames[] = { NULL, 0 } }; - --struct cmdname editnames[] = + +-struct cmdname editnames[] = +struct cmdname editnames[] = { { "back-complete", EC_B_COMPLETE }, { "backspace", EC_BACKSPACE }, -@@ -194,14 +194,14 @@ struct table vartable; +@@ -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, + 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, + C0_END_LESSKEY_MAGIC, + C1_END_LESSKEY_MAGIC, C2_END_LESSKEY_MAGIC }; char cmdsection[1] = { CMD_SECTION }; -@@ -248,8 +248,19 @@ homefile(filename) +@@ -250,8 +250,19 @@ homefile(filename) char *p; char *pathname; - + +#ifdef __HAIKU__ + char path[B_PATH_NAME_LENGTH+B_FILE_NAME_LENGTH]; + dev_t volume = dev_for_path("/boot"); @@ -717,51 +706,51 @@ index 686f6e4..8a8dc7e 100644 #if OS2 else if ((p = getenv("INIT")) != NULL && *p != '\0') pathname = mkpathname(p, filename); -@@ -440,7 +451,7 @@ tstr(pp, xlate) +@@ -442,7 +453,7 @@ tstr(pp, xlate) /* FALLTHRU */ default: /* -- * Backslash followed by any other char +- * Backslash followed by any other char + * Backslash followed by any other char * just means that char. */ *pp = p+1; -@@ -476,7 +487,7 @@ tstr(pp, xlate) +@@ -478,7 +489,7 @@ tstr(pp, xlate) skipsp(s) char *s; { -- while (*s == ' ' || *s == '\t') +- while (*s == ' ' || *s == '\t') + while (*s == ' ' || *s == '\t') s++; return (s); } -@@ -598,7 +609,7 @@ fputint(fd, val) - +@@ -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", + fprintf(stderr, "error: integer too big (%d > %d)\n", val, KRADIX*KRADIX); exit(1); } -@@ -788,7 +799,7 @@ main(argc, argv) +@@ -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) + + char *env = (char *) calloc(strlen(drive) + strlen(path) + 6, sizeof(char)); strcpy(env, "HOME="); strcat(env, drive); -@@ -867,7 +878,7 @@ main(argc, argv) +@@ -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)); + fputbytes(out, varsection, sizeof(varsection)); fputint(out, vartable.pbuffer - vartable.buffer); fputbytes(out, (char *)vartable.buffer, vartable.pbuffer-vartable.buffer); - --- -2.7.0 + +-- +2.14.2