Don't worry so much about environment variable names. - sam - An updated version of the sam text editor.
(HTM) git clone git://vernunftzentrum.de/sam.git
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) LICENSE
---
(DIR) commit 039c3a24e1e67a9535000f405d05b608fae65605
(DIR) parent 6e3bec19eaac9e8f3f7f14492c9d680525d61ab4
(HTM) Author: Rob King <jking@deadpixi.com>
Date: Thu, 11 Aug 2016 14:18:42 -0500
Don't worry so much about environment variable names.
Diffstat:
config.h | 5 -----
libXg/latin1.c | 4 ++--
rsam/rsam.c | 2 +-
sam/sam.c | 2 +-
samterm/unix.c | 2 +-
5 files changed, 5 insertions(+), 10 deletions(-)
---
(DIR) diff --git a/config.h b/config.h
@@ -23,11 +23,6 @@
#define UPKEY 0x81 /* Scroll up. */
#define ESC 0x1B /* Escape */
-/* The name of the environment variable that points to the user's home
- * directory.
- */
-#define HOMEENV "HOME"
-
/* The remote shell to use for remote connections. */
#define RXPATH "/usr/bin/ssh"
(DIR) diff --git a/libXg/latin1.c b/libXg/latin1.c
@@ -238,10 +238,10 @@ void
initlatin(void)
{
FILE *keyboard = NULL;
- if (getenv(HOMEENV))
+ if (getenv("HOME"))
{
char path[1024] = {0};
- snprintf(path, 1023, "%s/.keyboard", getenv(HOMEENV));
+ snprintf(path, 1023, "%s/.keyboard", getenv("HOME"));
keyboard = fopen(path, "r");
}
(DIR) diff --git a/rsam/rsam.c b/rsam/rsam.c
@@ -37,7 +37,7 @@ cleanup(void)
int
main(int argc, char **argv)
{
- const char *home = getenv(HOMEENV) ? getenv(HOMEENV) : "/tmp";
+ const char *home = getenv("HOME") ? getenv("HOME") : TMPDIR;
long pathmax = pathconf(home, _PC_PATH_MAX) != -1 ? pathconf(home, _PC_PATH_MAX) : PATH_MAX;
int writepipe[2] = {-1};
int readpipe[2] = {-1};
(DIR) diff --git a/sam/sam.c b/sam/sam.c
@@ -95,7 +95,7 @@ main(int argc, char *argv[])
Strinit0(&wd);
tempfile.listptr = emalloc(0);
Strinit0(&plan9cmd);
- home = getenv(HOMEENV);
+ home = getenv("HOME");
if(home == 0)
home = "/";
if(!dflag)
(DIR) diff --git a/samterm/unix.c b/samterm/unix.c
@@ -95,7 +95,7 @@ extstart(void)
int flags;
user = getuser();
- home = getenv(HOMEENV);
+ home = getenv("HOME");
if (home == NULL)
{