Don't worry so much about environment variable names. - sam - An updated versio… | |
git clone git://vernunftzentrum.de/sam.git | |
Log | |
Files | |
Refs | |
LICENSE | |
--- | |
commit 039c3a24e1e67a9535000f405d05b608fae65605 | |
parent 6e3bec19eaac9e8f3f7f14492c9d680525d61ab4 | |
Author: Rob King <[email protected]> | |
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(-) | |
--- | |
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" | |
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"); | |
} | |
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 ? pathco… | |
int writepipe[2] = {-1}; | |
int readpipe[2] = {-1}; | |
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) | |
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) | |
{ |