Less : bump (#2513)

This commit is contained in:
miqlas
2018-05-01 20:35:03 +02:00
committed by fbrosson
parent 098fcc483b
commit 46e6f3a802
8 changed files with 16 additions and 811 deletions

View File

@@ -1,63 +0,0 @@
SUMMARY="A free, open-source file pager"
DESCRIPTION="GNU less is a program similar to more, but which allows \
backward movement in the file as well as forward movement. Also, less \
does not have to read the entire input file before starting, so with \
large input files it starts up faster than text editors like vi. Less uses \
termcap (or terminfo on some systems), so it can run on a variety of \
terminals. There is even limited support for hardcopy terminals."
HOMEPAGE="http://www.gnu.org/software/less/"
SOURCE_URI="http://ftp.gnu.org/gnu/less/less-$portVersion.tar.gz"
CHECKSUM_SHA256="9fe8287c647afeafb4149c5dedaeacfd20971ed7c26c7553794bb750536b5f57"
PATCHES="less-451.patch"
ADDITIONAL_FILES="sysless.in"
LICENSE="GNU GPL v3"
COPYRIGHT="1984-2012 Mark Nudelman"
REVISION="4"
ARCHITECTURES="x86_gcc2 x86 x86_64"
PROVIDES="
less = $portVersion
cmd:less
cmd:lessecho
cmd:lesskey
"
REQUIRES="
haiku$secondaryArchSuffix
lib:libncurses$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libncurses$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:gcc$secondaryArchSuffix
cmd:make
cmd:ld$secondaryArchSuffix
cmd:autoconf
cmd:aclocal
"
GLOBAL_WRITABLE_FILES="
settings/etc/sysless.src keep-old
settings/etc/sysless keep-old
"
BUILD()
{
autoconf
runConfigure ./configure --with-editor=nano \
--sysconfdir=$settingsDir/etc
make
}
INSTALL()
{
make install
syslessDir=$settingsDir/etc
mkdir $syslessDir
cp "$portDir/additional-files/sysless.in" \
"$syslessDir/sysless.src"
$binDir/lesskey -o "$syslessDir/sysless" \
"$syslessDir/sysless.src"
}

View File

@@ -1,68 +0,0 @@
SUMMARY="A free, open-source file pager"
DESCRIPTION="GNU less is a program similar to more, but which allows \
backward movement in the file as well as forward movement. Also, less \
does not have to read the entire input file before starting, so with \
large input files it starts up faster than text editors like vi. Less uses \
termcap (or terminfo on some systems), so it can run on a variety of \
terminals. There is even limited support for hardcopy terminals."
HOMEPAGE="http://www.greenwoodsoftware.com/less/"
SOURCE_URI="http://www.greenwoodsoftware.com/less/less-$portVersion.tar.gz"
CHECKSUM_SHA256="e536c7819ede54b3d487f0ffc4c14b3620bed83734d92a81e89f62346db0fcac"
PATCHES="less-$portVersion.patchset"
ADDITIONAL_FILES="sysless.in"
LICENSE="GNU GPL v3"
COPYRIGHT="1984-2014 Mark Nudelman"
REVISION="4"
ARCHITECTURES="x86_gcc2 x86 x86_64"
PROVIDES="
less = $portVersion
cmd:less
cmd:lessecho
cmd:lesskey
"
REQUIRES="
haiku$secondaryArchSuffix
lib:libncurses$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libncurses$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:gcc$secondaryArchSuffix
cmd:make
cmd:ld$secondaryArchSuffix
cmd:autoconf
cmd:aclocal
"
GLOBAL_WRITABLE_FILES="
settings/etc/sysless.src keep-old
settings/etc/sysless keep-old
"
defineDebugInfoPackage less \
$binDir/less \
$binDir/lessecho \
$binDir/lesskey
BUILD()
{
autoconf
runConfigure ./configure --with-editor=nano \
--sysconfdir=$settingsDir/etc
make
}
INSTALL()
{
make install
syslessDir=$settingsDir/etc
mkdir $syslessDir
cp "$portDir/additional-files/sysless.in" \
"$syslessDir/sysless.src"
$binDir/lesskey -o "$syslessDir/sysless" \
"$syslessDir/sysless.src"
}

View File

@@ -1,65 +0,0 @@
SUMMARY="A free, open-source file pager"
DESCRIPTION="GNU 'less' is a program similar to 'more', but which allows \
backward movement in the file as well as forward movement. Also, 'less' \
does not have to read the entire input file before starting, so with \
large input files it starts up faster than text editors like 'vi'.
Less uses 'termcap' (or 'terminfo' on some systems), so it can run on a \
variety of terminals. There is even limited support for hardcopy terminals."
HOMEPAGE="http://www.greenwoodsoftware.com/less/"
COPYRIGHT="1984-2015 Mark Nudelman"
LICENSE="GNU GPL v3"
REVISION="1"
SOURCE_URI="http://www.greenwoodsoftware.com/less/less-$portVersion.tar.gz"
CHECKSUM_SHA256="dba42cd4c38174b7bd0d426d8a39df2be6bcc1ec18946a4642713290f6bf9a0b"
PATCHES="less-$portVersion.patchset"
ADDITIONAL_FILES="sysless.in"
ARCHITECTURES="?x86_gcc2 ?x86 ?x86_64"
PROVIDES="
less = $portVersion
cmd:less
cmd:lessecho
cmd:lesskey
"
REQUIRES="
haiku$secondaryArchSuffix
lib:libncurses$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libncurses$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:gcc$secondaryArchSuffix
cmd:make
cmd:ld$secondaryArchSuffix
cmd:autoconf
cmd:aclocal
"
GLOBAL_WRITABLE_FILES="
settings/etc/sysless.src keep-old
settings/etc/sysless keep-old
"
BUILD()
{
autoconf
runConfigure ./configure --with-editor=nano \
--sysconfdir=$settingsDir/etc
make
}
INSTALL()
{
make install
syslessDir=$settingsDir/etc
mkdir $syslessDir
cp "$portDir/additional-files/sysless.in" \
"$syslessDir/sysless.src"
$binDir/lesskey -o "$syslessDir/sysless" \
"$syslessDir/sysless.src"
}

View File

@@ -6,11 +6,11 @@ large input files it starts up faster than text editors like 'vi'.
Less uses 'termcap' (or 'terminfo' on some systems), so it can run on a \
variety of terminals. There is even limited support for hardcopy terminals."
HOMEPAGE="http://www.greenwoodsoftware.com/less/"
COPYRIGHT="1984-2015 Mark Nudelman"
COPYRIGHT="1984-2017 Mark Nudelman"
LICENSE="GNU GPL v3"
REVISION="3"
REVISION="1"
SOURCE_URI="http://www.greenwoodsoftware.com/less/less-$portVersion.tar.gz"
CHECKSUM_SHA256="3fa38f2cf5e9e040bb44fffaa6c76a84506e379e47f5a04686ab78102090dda5"
CHECKSUM_SHA256="503f91ab0af4846f34f0444ab71c4b286123f0044a4964f1ae781486c617f2e2"
PATCHES="less-$portVersion.patchset"
ADDITIONAL_FILES="sysless.in"

View File

@@ -1,128 +0,0 @@
diff -urN less-451/cmdbuf.c less-451-haiku/cmdbuf.c
--- less-451/cmdbuf.c 2012-07-21 20:39:58.045088768 +0000
+++ less-451-haiku/cmdbuf.c 2012-09-06 18:17:44.432799744 +0000
@@ -1364,7 +1364,11 @@
static char *
histfile_name()
{
+#ifdef __HAIKU__
+ char home[B_PATH_NAME_LENGTH+B_FILE_NAME_LENGTH];
+#else
char *home;
+#endif
char *name;
int len;
@@ -1378,6 +1382,13 @@
return (save(name));
}
+#ifdef __HAIKU__
+ {
+ dev_t volume = dev_for_path("/boot");
+ if (find_directory(B_USER_SETTINGS_DIRECTORY, volume, true, home, sizeof(home)) != B_OK)
+ return (NULL);
+ }
+#else
/* Otherwise, file is in $HOME. */
home = lgetenv("HOME");
if (home == NULL || *home == '\0')
@@ -1388,6 +1399,8 @@
#endif
return (NULL);
}
+#endif
+
len = strlen(home) + strlen(LESSHISTFILE) + 2;
name = (char *) ecalloc(len, sizeof(char));
SNPRINTF2(name, len, "%s/%s", home, LESSHISTFILE);
diff -urN less-451/configure.ac less-451-haiku/configure.ac
--- less-451/configure.ac 2012-07-21 20:39:59.045613056 +0000
+++ less-451-haiku/configure.ac 2012-09-06 18:17:49.640942080 +0000
@@ -589,10 +589,17 @@
* LESSHISTFILE is the filename of the history file
* (in the HOME directory).
*/
-#define LESSKEYFILE ".less"
-#define LESSKEYFILE_SYS SYSDIR "/sysless"
-#define DEF_LESSKEYINFILE ".lesskey"
-#define LESSHISTFILE ".lesshst"
+#ifdef __HAIKU__
+# define LESSKEYFILE "less"
+# define LESSKEYFILE_SYS SYSDIR "/sysless"
+# define DEF_LESSKEYINFILE "lesskey"
+# define LESSHISTFILE "lesshst"
+#else
+# define LESSKEYFILE ".less"
+# define LESSKEYFILE_SYS SYSDIR "/sysless"
+# define DEF_LESSKEYINFILE ".lesskey"
+# define LESSHISTFILE ".lesshst"
+#endif
/* Settings always true on Unix. */
diff -urN less-451/filename.c less-451-haiku/filename.c
--- less-451/filename.c 2012-07-21 20:39:58.046923776 +0000
+++ less-451-haiku/filename.c 2012-09-06 18:17:53.399507456 +0000
@@ -266,12 +266,23 @@
{
register char *pathname;
+#ifdef __HAIKU__
+ char path[B_PATH_NAME_LENGTH+B_FILE_NAME_LENGTH];
+ dev_t volume = dev_for_path("/boot");
+ if (find_directory(B_USER_SETTINGS_DIRECTORY, volume, true, path, sizeof(path)) != B_OK)
+ return (NULL);
+
+ pathname = dirfile(&path, filename);
+ if (pathname != NULL)
+ return (pathname);
+#else
/*
* Try $HOME/filename.
*/
pathname = dirfile(lgetenv("HOME"), filename);
if (pathname != NULL)
return (pathname);
+#endif
#if OS2
/*
* Try $INIT/filename.
diff -urN less-451/less.h less-451-haiku/less.h
--- less-451/less.h 2012-07-21 20:39:59.047972352 +0000
+++ less-451-haiku/less.h 2012-09-06 18:17:57.216268800 +0000
@@ -93,6 +93,11 @@
#include <floss.h>
#endif
+#ifdef __HAIKU__
+#include <FindDirectory.h>
+#include <StorageDefs.h>
+#endif
+
#if MSDOS_COMPILER==WIN32C || OS2
#include <io.h>
#endif
diff -urN less-451/lesskey.c less-451-haiku/lesskey.c
--- less-451/lesskey.c 2012-07-21 20:39:59.049020928 +0000
+++ less-451-haiku/lesskey.c 2012-09-06 18:18:06.898891776 +0000
@@ -245,8 +245,19 @@
char *p;
char *pathname;
+#ifdef __HAIKU__
+ char path[B_PATH_NAME_LENGTH+B_FILE_NAME_LENGTH];
+ dev_t volume = dev_for_path("/boot");
+ if (find_directory(B_USER_SETTINGS_DIRECTORY, volume, true, path, sizeof(path)) != B_OK)
+ return (NULL);
+
+ pathname = mkpathname(&path, filename);
+ if (pathname != NULL)
+ return (pathname);
+#else
if ((p = getenv("HOME")) != NULL && *p != '\0')
pathname = mkpathname(p, filename);
+#endif
#if OS2
else if ((p = getenv("INIT")) != NULL && *p != '\0')
pathname = mkpathname(p, filename);

View File

@@ -1,142 +0,0 @@
From 84d816bea8e0c4bf9a8073ac66ffb6d8d9a3a06d Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Wed, 3 Sep 2014 15:09:24 +0000
Subject: haiku patch
diff --git a/cmdbuf.c b/cmdbuf.c
index 604c536..e9b7957 100755
--- a/cmdbuf.c
+++ b/cmdbuf.c
@@ -1378,7 +1378,11 @@ mlist_size(ml)
static char *
histfile_name()
{
+#ifdef __HAIKU__
+ char home[B_PATH_NAME_LENGTH+B_FILE_NAME_LENGTH];
+#else
char *home;
+#endif
char *name;
int len;
@@ -1392,6 +1396,13 @@ histfile_name()
return (save(name));
}
+#ifdef __HAIKU__
+ {
+ dev_t volume = dev_for_path("/boot");
+ if (find_directory(B_USER_SETTINGS_DIRECTORY, volume, true, home, sizeof(home)) != B_OK)
+ return (NULL);
+ }
+#else
/* Otherwise, file is in $HOME. */
home = lgetenv("HOME");
if (home == NULL || *home == '\0')
@@ -1402,6 +1413,8 @@ histfile_name()
#endif
return (NULL);
}
+#endif
+
len = strlen(home) + strlen(LESSHISTFILE) + 2;
name = (char *) ecalloc(len, sizeof(char));
SNPRINTF2(name, len, "%s/%s", home, LESSHISTFILE);
diff --git a/configure.ac b/configure.ac
index 4ac9a35..d9e299a 100755
--- a/configure.ac
+++ b/configure.ac
@@ -596,10 +596,17 @@ AH_TOP([
* LESSHISTFILE is the filename of the history file
* (in the HOME directory).
*/
-#define LESSKEYFILE ".less"
-#define LESSKEYFILE_SYS SYSDIR "/sysless"
-#define DEF_LESSKEYINFILE ".lesskey"
-#define LESSHISTFILE ".lesshst"
+#ifdef __HAIKU__
+# define LESSKEYFILE "less"
+# define LESSKEYFILE_SYS SYSDIR "/sysless"
+# define DEF_LESSKEYINFILE "lesskey"
+# define LESSHISTFILE "lesshst"
+#else
+# define LESSKEYFILE ".less"
+# define LESSKEYFILE_SYS SYSDIR "/sysless"
+# define DEF_LESSKEYINFILE ".lesskey"
+# define LESSHISTFILE ".lesshst"
+#endif
/* Settings always true on Unix. */
diff --git a/filename.c b/filename.c
index 68fdadb..5d2b614 100755
--- a/filename.c
+++ b/filename.c
@@ -266,12 +266,23 @@ homefile(filename)
{
register char *pathname;
+#ifdef __HAIKU__
+ char path[B_PATH_NAME_LENGTH+B_FILE_NAME_LENGTH];
+ dev_t volume = dev_for_path("/boot");
+ if (find_directory(B_USER_SETTINGS_DIRECTORY, volume, true, path, sizeof(path)) != B_OK)
+ return (NULL);
+
+ pathname = dirfile(&path, filename);
+ if (pathname != NULL)
+ return (pathname);
+#else
/*
* Try $HOME/filename.
*/
pathname = dirfile(lgetenv("HOME"), filename);
if (pathname != NULL)
return (pathname);
+#endif
#if OS2
/*
* Try $INIT/filename.
diff --git a/less.h b/less.h
index 15c55af..56bfa64 100755
--- a/less.h
+++ b/less.h
@@ -93,6 +93,11 @@
#include <floss.h>
#endif
+#ifdef __HAIKU__
+#include <FindDirectory.h>
+#include <StorageDefs.h>
+#endif
+
#if MSDOS_COMPILER==WIN32C || OS2
#include <io.h>
#endif
diff --git a/lesskey.c b/lesskey.c
index 3408647..da8aba3 100755
--- a/lesskey.c
+++ b/lesskey.c
@@ -246,8 +246,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");
+ if (find_directory(B_USER_SETTINGS_DIRECTORY, volume, true, path, sizeof(path)) != B_OK)
+ return (NULL);
+
+ pathname = mkpathname(&path, filename);
+ if (pathname != NULL)
+ return (pathname);
+#else
if ((p = getenv("HOME")) != NULL && *p != '\0')
pathname = mkpathname(p, filename);
+#endif
#if OS2
else if ((p = getenv("INIT")) != NULL && *p != '\0')
pathname = mkpathname(p, filename);
--
1.8.3.4

View File

@@ -1,329 +0,0 @@
From ffa25716611e1af39cf5cd4f6a1248d208040374 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Wed, 3 Sep 2014 15:09:24 +0000
Subject: haiku patch
diff --git a/cmdbuf.c b/cmdbuf.c
index 69d7414..6686cdf 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 * constant ml_search = (void *) &mlist_search;
-struct mlist mlist_examine =
+struct mlist mlist_examine =
{ &mlist_examine, &mlist_examine, &mlist_examine, NULL, 0 };
public void * constant 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 * constant ml_shell = (void *) &mlist_shell;
#endif
@@ -420,7 +420,7 @@ cmd_right()
char *pr;
char *ncp;
int width;
-
+
if (*cp == '\0')
{
/* Already at the end of the line. */
@@ -454,7 +454,7 @@ cmd_left()
{
char *ncp;
int width, bswidth;
-
+
if (cp <= cmdbuf)
{
/* Already at the beginning of the line */
@@ -485,14 +485,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).
*/
@@ -552,7 +552,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.
@@ -689,7 +689,7 @@ cmd_updown(action)
{
char *s;
struct mlist *ml;
-
+
if (curr_mlist == NULL)
{
/*
@@ -754,7 +754,7 @@ cmd_addhist(mlist, cmd, modified)
{
#if CMD_HISTORY
struct mlist *ml;
-
+
/*
* Don't save a trivial command.
*/
@@ -826,7 +826,7 @@ cmd_edit(c)
#else
#define not_in_completion()
#endif
-
+
/*
* See if the char is indeed a line-editing command.
*/
@@ -937,7 +937,7 @@ cmd_istr(str)
char *s;
int action;
char *endline = str + strlen(str);
-
+
for (s = str; *s != '\0'; )
{
char *os = s;
@@ -969,7 +969,7 @@ delimit_word()
char *esc = get_meta_escape();
int esclen = (int) strlen(esc);
#endif
-
+
/*
* Move cursor to end of word.
*/
@@ -1042,7 +1042,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
@@ -1050,7 +1050,7 @@ init_compl()
{
char *word;
char c;
-
+
/*
* Get rid of any previous tk_text.
*/
@@ -1139,8 +1139,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();
@@ -1172,13 +1172,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)
{
/*
@@ -1209,9 +1209,9 @@ cmd_complete(action)
goto fail;
}
}
-
+
return (CC_OK);
-
+
fail:
in_completion = 0;
bell();
@@ -1292,7 +1292,7 @@ cmd_char(c)
literal = 0;
return (cmd_ichar(cmd_mbc_buf, len));
}
-
+
/*
* See if it is a line-editing character.
*/
@@ -1308,7 +1308,7 @@ cmd_char(c)
break;
}
}
-
+
/*
* Insert the char into the command buffer.
*/
@@ -1378,10 +1378,14 @@ mlist_size(ml)
static char *
histfile_name()
{
+#ifdef __HAIKU__
+ char home[B_PATH_NAME_LENGTH+B_FILE_NAME_LENGTH];
+#else
char *home;
+#endif
char *name;
int len;
-
+
/* See if filename is explicitly specified by $LESSHISTFILE. */
name = lgetenv("LESSHISTFILE");
if (name != NULL && *name != '\0')
@@ -1396,6 +1400,13 @@ histfile_name()
if (strcmp(LESSHISTFILE, "") == 0 || strcmp(LESSHISTFILE, "-") == 0)
return (NULL);
+#ifdef __HAIKU__
+ {
+ dev_t volume = dev_for_path("/boot");
+ if (find_directory(B_USER_SETTINGS_DIRECTORY, volume, true, home, sizeof(home)) != B_OK)
+ return (NULL);
+ }
+#else
/* Otherwise, file is in $HOME. */
home = lgetenv("HOME");
if (home == NULL || *home == '\0')
@@ -1406,6 +1417,7 @@ histfile_name()
#endif
return (NULL);
}
+#endif
len = (int) (strlen(home) + strlen(LESSHISTFILE) + 2);
name = (char *) ecalloc(len, sizeof(char));
SNPRINTF2(name, len, "%s/%s", home, LESSHISTFILE);
diff --git a/configure.ac b/configure.ac
index 4ac9a35..d9e299a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -596,10 +596,17 @@ AH_TOP([
* LESSHISTFILE is the filename of the history file
* (in the HOME directory).
*/
-#define LESSKEYFILE ".less"
-#define LESSKEYFILE_SYS SYSDIR "/sysless"
-#define DEF_LESSKEYINFILE ".lesskey"
-#define LESSHISTFILE ".lesshst"
+#ifdef __HAIKU__
+# define LESSKEYFILE "less"
+# define LESSKEYFILE_SYS SYSDIR "/sysless"
+# define DEF_LESSKEYINFILE "lesskey"
+# define LESSHISTFILE "lesshst"
+#else
+# define LESSKEYFILE ".less"
+# define LESSKEYFILE_SYS SYSDIR "/sysless"
+# define DEF_LESSKEYINFILE ".lesskey"
+# define LESSHISTFILE ".lesshst"
+#endif
/* Settings always true on Unix. */
diff --git a/filename.c b/filename.c
index 9631f1c..dc13a96 100644
--- a/filename.c
+++ b/filename.c
@@ -266,12 +266,23 @@ homefile(filename)
{
register char *pathname;
+#ifdef __HAIKU__
+ char path[B_PATH_NAME_LENGTH+B_FILE_NAME_LENGTH];
+ dev_t volume = dev_for_path("/boot");
+ if (find_directory(B_USER_SETTINGS_DIRECTORY, volume, true, path, sizeof(path)) != B_OK)
+ return (NULL);
+
+ pathname = dirfile(&path, filename);
+ if (pathname != NULL)
+ return (pathname);
+#else
/*
* Try $HOME/filename.
*/
pathname = dirfile(lgetenv("HOME"), filename);
if (pathname != NULL)
return (pathname);
+#endif
#if OS2
/*
* Try $INIT/filename.
diff --git a/less.h b/less.h
index f57fb1e..17159dd 100644
--- a/less.h
+++ b/less.h
@@ -93,6 +93,11 @@
#include <floss.h>
#endif
+#ifdef __HAIKU__
+#include <FindDirectory.h>
+#include <StorageDefs.h>
+#endif
+
#if MSDOS_COMPILER==WIN32C || OS2
#include <io.h>
#endif
diff --git a/lesskey.c b/lesskey.c
index 298748b..fa4c05b 100644
--- a/lesskey.c
+++ b/lesskey.c
@@ -246,8 +246,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");
+ if (find_directory(B_USER_SETTINGS_DIRECTORY, volume, true, path, sizeof(path)) != B_OK)
+ return (NULL);
+
+ pathname = mkpathname(&path, filename);
+ if (pathname != NULL)
+ return (pathname);
+#else
if ((p = getenv("HOME")) != NULL && *p != '\0')
pathname = mkpathname(p, filename);
+#endif
#if OS2
else if ((p = getenv("INIT")) != NULL && *p != '\0')
pathname = mkpathname(p, filename);
--
2.2.2

View File

@@ -381,7 +381,7 @@ index 3616ef0..144a8be 100644
*/
#define HAVE_DUP 1
diff --git a/filename.c b/filename.c
index 1c0ae42..b9d322a 100644
index 983a02b..0343df1 100644
--- a/filename.c
+++ b/filename.c
@@ -164,7 +164,7 @@ shell_quote(s)
@@ -437,7 +437,7 @@ index 1c0ae42..b9d322a 100644
* but "FILE.A" is globbed as "FILE.A*").
*/
{
@@ -528,8 +539,8 @@ readfd(fd)
@@ -526,8 +537,8 @@ readfd(fd)
int ch;
char *buf;
char *p;
@@ -448,7 +448,7 @@ index 1c0ae42..b9d322a 100644
* Make a guess about how many chars in the string
* and allocate a buffer to hold it.
*/
@@ -585,7 +596,7 @@ shellcmd(cmd)
@@ -583,7 +594,7 @@ shellcmd(cmd)
char *esccmd;
/*
@@ -457,7 +457,7 @@ index 1c0ae42..b9d322a 100644
* Escape any metacharacters in the command.
*/
esccmd = shell_quote(cmd);
@@ -686,7 +697,7 @@ lglob(filename)
@@ -684,7 +695,7 @@ lglob(filename)
char *pfilename;
char *qfilename;
DECL_GLOB_NAME(fnd,drive,dir,fname,ext,handle)
@@ -466,7 +466,7 @@ index 1c0ae42..b9d322a 100644
GLOB_FIRST_NAME(filename, &fnd, handle);
if (GLOB_FIRST_FAILED(handle))
{
@@ -825,7 +836,7 @@ num_pct_s(lessopen)
@@ -823,7 +834,7 @@ num_pct_s(lessopen)
}
/*
@@ -475,7 +475,7 @@ index 1c0ae42..b9d322a 100644
* instead of the file we're about to open.
*/
public char *
@@ -845,7 +856,7 @@ open_altfile(filename, pf, pfd)
@@ -843,7 +854,7 @@ open_altfile(filename, pf, pfd)
#if HAVE_FILENO
int returnfd = 0;
#endif
@@ -484,7 +484,7 @@ index 1c0ae42..b9d322a 100644
if (!use_lessopen || secure)
return (NULL);
ch_ungetchar(-1);
@@ -854,7 +865,7 @@ open_altfile(filename, pf, pfd)
@@ -852,7 +863,7 @@ open_altfile(filename, pf, pfd)
while (*lessopen == '|')
{
/*
@@ -493,7 +493,7 @@ index 1c0ae42..b9d322a 100644
* a "pipe preprocessor".
*/
#if !HAVE_FILENO
@@ -914,7 +925,7 @@ open_altfile(filename, pf, pfd)
@@ -912,7 +923,7 @@ open_altfile(filename, pf, pfd)
/*
* Pipe is empty.
* If more than 1 pipe char was specified,
@@ -502,7 +502,7 @@ index 1c0ae42..b9d322a 100644
* is empty, or if there is no alt file.
* If only one pipe char, just assume no alt file.
*/
@@ -956,13 +967,13 @@ close_altfile(altfilename, filename)
@@ -954,13 +965,13 @@ close_altfile(altfilename, filename)
FILE *fd;
char *cmd;
int len;
@@ -518,7 +518,7 @@ index 1c0ae42..b9d322a 100644
{
error("LESSCLOSE ignored; must contain no more than 2 %%s", NULL_PARG);
return;
@@ -976,7 +987,7 @@ close_altfile(altfilename, filename)
@@ -974,7 +985,7 @@ close_altfile(altfilename, filename)
pclose(fd);
#endif
}
@@ -527,7 +527,7 @@ index 1c0ae42..b9d322a 100644
/*
* Is the specified file a directory?
*/
@@ -1024,7 +1035,7 @@ bad_file(filename)
@@ -1022,7 +1033,7 @@ bad_file(filename)
{
static char is_a_dir[] = " is a directory";
@@ -536,7 +536,7 @@ index 1c0ae42..b9d322a 100644
sizeof(char));
strcpy(m, filename);
strcat(m, is_a_dir);
@@ -1079,7 +1090,7 @@ filesize(f)
@@ -1077,7 +1088,7 @@ filesize(f)
}
/*
@@ -580,7 +580,7 @@ index 39ca65e..203d620 100644
struct wchar_range *table;
int count;
diff --git a/lesskey.c b/lesskey.c
index 9fd0a9f..f7b065b 100644
index fa1ab6d..5fa3735 100644
--- a/lesskey.c
+++ b/lesskey.c
@@ -11,7 +11,7 @@