diff --git a/src/os_amiga.c b/src/os_amiga.c index d09974f949..aa50779eca 100644 --- a/src/os_amiga.c +++ b/src/os_amiga.c @@ -1768,3 +1768,31 @@ mch_setenv(char *var, char *value, int x UNUSED) return 0; // success return -1; // failure } + +/* + * Fill the buffer 'buf' with 'len' random bytes. + * Returns FAIL if RANDOM: is not available or something went wrong. + */ + int +mch_get_random(char_u *buf, int len) +{ + struct Process *proc = (struct Process *) FindTask(0L); + APTR win = proc->pr_WindowPtr; + + // Don't show requester if RANDOM: doesn't exist + proc->pr_WindowPtr = (APTR) -1L; + + BPTR fh = Open("RANDOM:", MODE_OLDFILE); + + proc->pr_WindowPtr = win; + + int status; + + if (!fh || Read(fh, buf, len) != len) + status = FAIL; + else + status = OK; + + Close(fh); + return status; +} diff --git a/src/proto/os_amiga.pro b/src/proto/os_amiga.pro old mode 100644 new mode 100755 index abebae154f..86d14903d9 --- a/src/proto/os_amiga.pro +++ b/src/proto/os_amiga.pro @@ -43,4 +43,5 @@ int mch_has_exp_wildcard(char_u *p); int mch_has_wildcard(char_u *p); char_u *mch_getenv(char_u *var); int mch_setenv(char *var, char *value, int x); +int mch_get_random(char_u *buf, int len); /* vim: set ft=c : */ diff --git a/src/version.c b/src/version.c index b82a01a92f..5c74bc0e13 100644 --- a/src/version.c +++ b/src/version.c @@ -729,6 +729,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1811, /**/ 1810, /**/