summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Luka Šijanec <sijanecantonluka@gmail.com>2020-06-09 17:46:26 +0200
committerAnton Luka Šijanec <sijanecantonluka@gmail.com>2020-06-09 17:46:26 +0200
commit18bf28bbed19f7a10ca72ea615e4e9e25c340fb7 (patch)
tree9bd9b464d8e5c979a7b963e65ef7c2ba6f22a8f5
parentfix (diff)
downloadbverbose-18bf28bbed19f7a10ca72ea615e4e9e25c340fb7.tar
bverbose-18bf28bbed19f7a10ca72ea615e4e9e25c340fb7.tar.gz
bverbose-18bf28bbed19f7a10ca72ea615e4e9e25c340fb7.tar.bz2
bverbose-18bf28bbed19f7a10ca72ea615e4e9e25c340fb7.tar.lz
bverbose-18bf28bbed19f7a10ca72ea615e4e9e25c340fb7.tar.xz
bverbose-18bf28bbed19f7a10ca72ea615e4e9e25c340fb7.tar.zst
bverbose-18bf28bbed19f7a10ca72ea615e4e9e25c340fb7.zip
-rwxr-xr-xbin/bvr-compose-htmlbin31984 -> 31984 bytes
-rwxr-xr-xbin/bvr-compose-singlebin31840 -> 31840 bytes
-rw-r--r--src/bvrcommands.c10
-rw-r--r--test/tape-test.bvr1
-rw-r--r--tmp/output.htm3
5 files changed, 10 insertions, 4 deletions
diff --git a/bin/bvr-compose-html b/bin/bvr-compose-html
index 505c2ec..2970376 100755
--- a/bin/bvr-compose-html
+++ b/bin/bvr-compose-html
Binary files differ
diff --git a/bin/bvr-compose-single b/bin/bvr-compose-single
index 5500b8f..d31f97f 100755
--- a/bin/bvr-compose-single
+++ b/bin/bvr-compose-single
Binary files differ
diff --git a/src/bvrcommands.c b/src/bvrcommands.c
index 3468d98..9484e49 100644
--- a/src/bvrcommands.c
+++ b/src/bvrcommands.c
@@ -287,7 +287,8 @@ int bvr_handle_equals(FILE * input, FILE * output) {
int bvr_handle_if(FILE * input, FILE * output) { // ?f 1 <@this is all executed@>
// first argument must *POINT* to a string which evaluates to 1, the second argument is the value of the endif string, spaces
// are argument delimeters. endif is only used for skipping forward if if should not execute.
- char * chars_to_break_value = " ";
+
+ char chars_to_break_value[69] = " ";
strlcat(chars_to_break_value, BVR_CHARS_TO_BREAK_VALUE, sizeof(chars_to_break_value));
char * item = bvr_commands_get_value(input, chars_to_break_value);
int return_value = 0;
@@ -304,8 +305,11 @@ int bvr_handle_if(FILE * input, FILE * output) { // ?f 1 <@this is all executed@
char previous_char = 'a';
int depth = -1; // to increase to 0 after first <@
int we_re_in_a_comment = 0;
- while(input_char != BVR_CLOSING_COMMAND_TAG_CHAR_2 && previous_char != BVR_CLOSING_COMMAND_TAG_CHAR_1 && depth == 0 &&
- we_re_in_a_comment == 0) {
+ while(1) {
+ if((input_char == BVR_CLOSING_COMMAND_TAG_CHAR_2 && previous_char == BVR_CLOSING_COMMAND_TAG_CHAR_1 && depth == 0 &&
+ we_re_in_a_comment == 0)) {
+ break;
+ }
if(previous_char == BVR_OPENING_COMMAND_TAG_CHAR_1 && input_char == BVR_OPENING_COMMAND_TAG_CHAR_2) {
depth++;
} // this šubidubi doesn't account for <@ and @> in strings.
diff --git a/test/tape-test.bvr b/test/tape-test.bvr
index a89012c..0b1689e 100644
--- a/test/tape-test.bvr
+++ b/test/tape-test.bvr
@@ -4,3 +4,4 @@
<@?s branch_name .git/refs/heads/master@>
<@?s latest_commit ?u 0 -1 ?i ?g branch_name@>
<@?g latest_commit@>
+<@?f ?"11" <@?g ?"hello!"@>@>
diff --git a/tmp/output.htm b/tmp/output.htm
index ebeb0c0..7591237 100644
--- a/tmp/output.htm
+++ b/tmp/output.htm
@@ -19,4 +19,5 @@
-be2a485d3240007afe26c1335b56a4f3cbb91841
+1006e7fb17e31ea501eca6834253d288c2f6da59
+