From 954de8fea4bf669d58c7ae6886bd0bc7558699e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anton=20L=2E=20=C5=A0ijanec?= Date: Tue, 5 May 2020 21:35:34 +0200 Subject: another fix, so 404 aka not found files work (show error) --- a.out | Bin 21132 -> 21132 bytes src/bvrcommands.c | 17 +++++++++++++---- test/tape-test.bvr | 2 +- tmp/output.htm | 5 ++++- 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/a.out b/a.out index 4fc861c..b61da8e 100755 Binary files a/a.out and b/a.out differ diff --git a/src/bvrcommands.c b/src/bvrcommands.c index aac4800..f08c0ab 100644 --- a/src/bvrcommands.c +++ b/src/bvrcommands.c @@ -74,11 +74,20 @@ int bvr_handle_include(FILE * input, FILE * output) { while(stream == NULL) { singlepath = strrchr(path, BVR_PATH_SEPARATOR); if(singlepath == NULL) { - stream = fopen(path, "r"); // ob1 fuckery + strcpy(notgoodatnamingvariables, path); + strcat(notgoodatnamingvariables, item); + stream = fopen(notgoodatnamingvariables, "r"); // ob1 fuckery if(stream == NULL) { - fprintf(output, "\nbVerbose include error. File %s not found.\n", item); - fprintf(stderr, "[bvrcommands.c] bvr_handle_include: File %s not found.\n", item); - return FAILURE; + strcpy(notgoodatnamingvariables, path); + strcat(notgoodatnamingvariables, item); + strcat(notgoodatnamingvariables, BVR_COMMAND_FILE_EXT); + stream = fopen(notgoodatnamingvariables, "r"); // ob1 fuckery + if(stream == NULL) { + fprintf(output, "\nbVerbose include error. File %s not found.\n", item); + fprintf(stderr, "[bvrcommands.c] bvr_handle_include: File %s not found.\n", item); + return FAILURE; + } + break; } break; } diff --git a/test/tape-test.bvr b/test/tape-test.bvr index 1bf8761..0d4e496 100644 --- a/test/tape-test.bvr +++ b/test/tape-test.bvr @@ -1,5 +1,5 @@ <@?i assets/content/global.bvr @> -<@?i krneki@> +<@?i krneski @> # <@?g post_slug @> # <@?g bvr_include_path @> # <@?i tape-test-to-includes @> diff --git a/tmp/output.htm b/tmp/output.htm index b72385b..0117a70 100644 --- a/tmp/output.htm +++ b/tmp/output.htm @@ -19,5 +19,8 @@ -krneki123 +bVerbose include error. File krneski not found. +command handler for i with argument "krneski" returned an error code. + +bvr_inline_command_processor returned an error status. -- cgit v1.2.3