summaryrefslogtreecommitdiff
path: root/amiga/gui.c
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2015-11-24 20:57:40 +0000
committerChris Young <chris@unsatisfactorysoftware.co.uk>2015-11-24 20:57:40 +0000
commitfa87f197c214620b00bc07c38034b38efa638210 (patch)
treed56484e2b541f2f3369e97d2d6376086fc4f1d5e /amiga/gui.c
parent7733ece4724d164f31e3be337ed09022f97d1d0e (diff)
downloadnetsurf-fa87f197c214620b00bc07c38034b38efa638210.tar.gz
netsurf-fa87f197c214620b00bc07c38034b38efa638210.tar.bz2
Abort if we're on a write-protected volume
Partial fix for 2397
Diffstat (limited to 'amiga/gui.c')
-rw-r--r--amiga/gui.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/amiga/gui.c b/amiga/gui.c
index a3cd57bcc..6859143c8 100644
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -5483,6 +5483,30 @@ int main(int argc, char** argv)
}
}
+#ifdef __amigaos4__
+ if(LIB_IS_AT_LEAST((struct Library *)DOSBase, 51, 96)) {
+ struct InfoData *infodata = AllocDosObject(DOS_INFODATA, 0);
+ if(infodata == NULL) {
+ ami_misc_fatal_error("Failed to allocate memory");
+ return RETURN_FAIL;
+ }
+ GetDiskInfoTags(GDI_StringNameInput, users_dir,
+ GDI_InfoData, infodata,
+ TAG_DONE);
+ if(infodata->id_DiskState == ID_DISKSTATE_WRITE_PROTECTED) {
+ FreeDosObject(DOS_INFODATA, infodata);
+ ami_misc_fatal_error("Cannot run with user dir on a write-protected volume");
+ return RETURN_FAIL;
+ }
+ FreeDosObject(DOS_INFODATA, infodata);
+ } else {
+#else
+//FIXME for OS3 and older OS4
+#endif
+#ifdef __amigaos4__
+ }
+#endif
+
int len = strlen(current_user);
len += strlen(users_dir);
len += 2; /* for poss path sep and NULL term */