summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2012-03-30 18:18:15 +0000
committerChris Young <chris@unsatisfactorysoftware.co.uk>2012-03-30 18:18:15 +0000
commite30905be7505fc4ba7f01d496b59d56a6411431a (patch)
tree3c77a23b988af57d9585886b345afd1fa700ef71
parent5a42a7a791c8c0f267c4dbe07dff8455c3ad1235 (diff)
downloadnetsurf-e30905be7505fc4ba7f01d496b59d56a6411431a.tar.gz
netsurf-e30905be7505fc4ba7f01d496b59d56a6411431a.tar.bz2
Use 'user' env-var to determine username
svn path=/trunk/netsurf/; revision=13778
-rwxr-xr-xamiga/dist/Install11
-rwxr-xr-xamiga/gui.c9
2 files changed, 16 insertions, 4 deletions
diff --git a/amiga/dist/Install b/amiga/dist/Install
index ccfa431d1..c3d5af2f1 100755
--- a/amiga/dist/Install
+++ b/amiga/dist/Install
@@ -363,7 +363,12 @@
(complete 15)
-(set #options-exist (exists (tackon @default-dest "Users/Default/Choices")))
+(set #user (getenv "user"))
+(if (= #user "") (set #user "Default"))
+
+(set #user-dir (tackon (tackon @default-dest "Users") #user))
+(set #user-options (tackon #user-dir "Choices"))
+(set #options-exist (exists #user-options))
(set #searchengines-exist (exists (tackon @default-dest "Resources/SearchEngines")))
(set #aiss-theme "")
@@ -518,12 +523,12 @@
)
)
- (makedir (tackon @default-dest "Users/Default"))
+ (makedir #user-dir)
(textfile
(prompt "Setting default options")
(help @textfile-help)
- (dest (tackon @default-dest "Users/Default/Choices"))
+ (dest #user-options)
(append "theme:" #theme "\n")
(append "use_pubscreen:Workbench\n")
)
diff --git a/amiga/gui.c b/amiga/gui.c
index 88488dc63..e5d4fbe5f 100755
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -819,11 +819,18 @@ int main(int argc, char** argv)
char messages[100];
char script[1024];
char temp[1024];
+ BPTR lock = 0;
+ int32 user = 0;
Object *splash_window = ami_gui_splash_open();
- current_user = ASPrintf("Default");
+ user = GetVar("user", temp, 1024, GVF_GLOBAL_ONLY);
+ current_user = ASPrintf("%s", (user == -1) ? "Default" : temp);
current_user_dir = ASPrintf("PROGDIR:Users/%s", current_user);
+
+ if(lock = CreateDirTree(current_user_dir))
+ UnLock(lock);
+
current_user_options = ASPrintf("%s/Choices", current_user_dir);
if(ami_locate_resource(messages, "Messages") == false)