From f39183c0b04fa20b90b5a809f6cddcfd2020fe4e Mon Sep 17 00:00:00 2001 From: Raja Mukherji Date: Fri, 24 Feb 2023 21:03:00 +0000 Subject: [PATCH 1/2] Updates. --- src/target.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/target.c b/src/target.c index b4395ff..e2fa215 100644 --- a/src/target.c +++ b/src/target.c @@ -143,10 +143,7 @@ ML_METHODV("[]", TargetT, MLAnyT) { } for (int I = 1; I < Count; ++I) { int Error = target_depends_single(Args[I], Target); - if (Error) { - asm("int3"); - return ml_error("TypeError", "Invalid value in dependency list"); - } + if (Error) return ml_error("TypeError", "Invalid value in dependency list"); } return Args[0]; } From b008c757285be9c1948c44f92495c0eaa170d629 Mon Sep 17 00:00:00 2001 From: Raja Mukherji Date: Mon, 8 May 2023 08:08:36 +0100 Subject: [PATCH 2/2] Updates. --- debian/changelog | 5 +++-- minilang | 2 +- radb | 2 +- src/rabs.c | 8 ++++++-- src/rabs.h | 2 +- 5 files changed, 12 insertions(+), 7 deletions(-) diff --git a/debian/changelog b/debian/changelog index fad4c0d..aedc745 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -rabs (2.27.5) UNRELEASED; urgency=medium +rabs (2.28.1) UNRELEASED; urgency=medium * Updates. * Updates. @@ -50,5 +50,6 @@ rabs (2.27.5) UNRELEASED; urgency=medium * Updates. * Updates. * Updates. + * Updates. - -- Raja Mukherji Fri, 17 Feb 2023 09:45:21 +0000 + -- Raja Mukherji Mon, 08 May 2023 08:08:13 +0100 diff --git a/minilang b/minilang index 9caa11b..e97df49 160000 --- a/minilang +++ b/minilang @@ -1 +1 @@ -Subproject commit 9caa11b5a10064edb43312852d360b8462430944 +Subproject commit e97df49717682181483062c15d0e1a13ab0a4120 diff --git a/radb b/radb index a128980..37fe24d 160000 --- a/radb +++ b/radb @@ -1 +1 @@ -Subproject commit a128980d7668f7e48fa6e8a12b5577e2f484a3a6 +Subproject commit 37fe24d25dd144002c08ab249bfab0b064f5caa5 diff --git a/src/rabs.c b/src/rabs.c index 1f29798..ac785f1 100644 --- a/src/rabs.c +++ b/src/rabs.c @@ -710,11 +710,15 @@ ML_FUNCTION(Open) { //>file // Opens the file at path :mini:`Path` with the specified mode. ML_CHECK_ARG_COUNT(2); + ML_CHECK_ARG_TYPE(1, MLStringT); ml_stringbuffer_t Buffer[1] = {ML_STRINGBUFFER_INIT}; ml_value_t *Result = ml_stringbuffer_simple_append(Buffer, Args[0]); if (ml_is_error(Result)) return Result; - char *FileName = ml_stringbuffer_get_string(Buffer); - return ml_simple_inline((ml_value_t *)MLFileOpen, 2, ml_string(FileName, -1), Args[1]); + const char *Path = ml_stringbuffer_get_string(Buffer); + const char *Mode = ml_string_value(Args[1]); + FILE *Handle = fopen(Path, Mode); + if (!Handle) return ml_error("FileError", "failed to open %s in mode %s: %s", Path, Mode, strerror(errno)); + return ml_file(Handle); } static const char *find_root(const char *Path) { diff --git a/src/rabs.h b/src/rabs.h index 556a5e7..fd1d022 100644 --- a/src/rabs.h +++ b/src/rabs.h @@ -30,7 +30,7 @@ extern __thread target_t *CurrentTarget; ml_value_t *rabs_global(const char *Name); ml_value_t *rabs_ml_global(void *Data, const char *Name, const char *Source, int Line, int Mode); -#define CURRENT_VERSION 2, 27, 8 +#define CURRENT_VERSION 2, 28, 1 #define MINIMAL_VERSION 2, 10, 0 #endif