Skip to content

Commit

Permalink
Regenerate examples
Browse files Browse the repository at this point in the history
  • Loading branch information
laurenthuberdeau committed Aug 30, 2024
1 parent 42984a3 commit 65a64f2
Show file tree
Hide file tree
Showing 12 changed files with 21 additions and 21 deletions.
6 changes: 3 additions & 3 deletions examples/compiled/base64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ unpack_escaped_string() {
__buf="${__buf#?}" # Remove the current char from $__buf
;;
*)
__c=$(LC_CTYPE=C printf "%d" "'${__buf%"${__buf#?}"}")
__c=$(LC_CTYPE=C printf "%d" "'${__buf%"${__buf#?}"}"); __c=$((__c > 0 ? __c : 256 + __c))
__buf="${__buf#?}" # Remove the current char from $__buf
;;
esac
Expand Down Expand Up @@ -190,7 +190,7 @@ _getchar() {
fi
fi
fi
__c=$(LC_CTYPE=C printf "%d" "'${__stdin_buf%"${__stdin_buf#?}"}")
__c=$(LC_CTYPE=C printf "%d" "'${__stdin_buf%"${__stdin_buf#?}"}"); __c=$((__c > 0 ? __c : 256 + __c))
: $(($1 = __c))
__stdin_buf="${__stdin_buf#?}" # remove the current char from $__stdin_buf
}
Expand All @@ -206,7 +206,7 @@ unpack_string() {
# Remove all but first char
__char="${__str%"$__tail"}"
# Convert char to ASCII
__c=$(LC_CTYPE=C printf "%d" "'$__char")
__c=$(LC_CTYPE=C printf "%d" "'$__char"); __c=$((__c > 0 ? __c : 256 + __c))
# Write character to memory
: $((_$__ptr = __c))
# Continue with rest of string
Expand Down
4 changes: 2 additions & 2 deletions examples/compiled/cat.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ unpack_line() { # $1: Shell string, $2: Buffer, $3: Ends with EOF?
__buffer=$2
__ends_with_eof=$3
while [ ! -z "$__fgetc_buf" ]; do
__c=$(LC_CTYPE=C printf "%d" "'${__fgetc_buf%"${__fgetc_buf#?}"}")
__c=$(LC_CTYPE=C printf "%d" "'${__fgetc_buf%"${__fgetc_buf#?}"}"); __c=$((__c > 0 ? __c : 256 + __c))
: $((_$__buffer = __c))
__fgetc_buf=${__fgetc_buf#?} # Remove the first character
: $((__buffer += 1)) # Move to the next buffer position
Expand Down Expand Up @@ -272,7 +272,7 @@ unpack_string() {
# Remove all but first char
__char="${__str%"$__tail"}"
# Convert char to ASCII
__c=$(LC_CTYPE=C printf "%d" "'$__char")
__c=$(LC_CTYPE=C printf "%d" "'$__char"); __c=$((__c > 0 ? __c : 256 + __c))
# Write character to memory
: $((_$__ptr = __c))
# Continue with rest of string
Expand Down
4 changes: 2 additions & 2 deletions examples/compiled/cp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ unpack_line() { # $1: Shell string, $2: Buffer, $3: Ends with EOF?
__buffer=$2
__ends_with_eof=$3
while [ ! -z "$__fgetc_buf" ]; do
__c=$(LC_CTYPE=C printf "%d" "'${__fgetc_buf%"${__fgetc_buf#?}"}")
__c=$(LC_CTYPE=C printf "%d" "'${__fgetc_buf%"${__fgetc_buf#?}"}"); __c=$((__c > 0 ? __c : 256 + __c))
: $((_$__buffer = __c))
__fgetc_buf=${__fgetc_buf#?} # Remove the first character
: $((__buffer += 1)) # Move to the next buffer position
Expand Down Expand Up @@ -251,7 +251,7 @@ unpack_string() {
# Remove all but first char
__char="${__str%"$__tail"}"
# Convert char to ASCII
__c=$(LC_CTYPE=C printf "%d" "'$__char")
__c=$(LC_CTYPE=C printf "%d" "'$__char"); __c=$((__c > 0 ? __c : 256 + __c))
# Write character to memory
: $((_$__ptr = __c))
# Continue with rest of string
Expand Down
2 changes: 1 addition & 1 deletion examples/compiled/echo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ unpack_string() {
# Remove all but first char
__char="${__str%"$__tail"}"
# Convert char to ASCII
__c=$(LC_CTYPE=C printf "%d" "'$__char")
__c=$(LC_CTYPE=C printf "%d" "'$__char"); __c=$((__c > 0 ? __c : 256 + __c))
# Write character to memory
: $((_$__ptr = __c))
# Continue with rest of string
Expand Down
2 changes: 1 addition & 1 deletion examples/compiled/print-reverse.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ unpack_string() {
# Remove all but first char
__char="${__str%"$__tail"}"
# Convert char to ASCII
__c=$(LC_CTYPE=C printf "%d" "'$__char")
__c=$(LC_CTYPE=C printf "%d" "'$__char"); __c=$((__c > 0 ? __c : 256 + __c))
# Write character to memory
: $((_$__ptr = __c))
# Continue with rest of string
Expand Down
4 changes: 2 additions & 2 deletions examples/compiled/repl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ unpack_escaped_string() {
__buf="${__buf#?}" # Remove the current char from $__buf
;;
*)
__c=$(LC_CTYPE=C printf "%d" "'${__buf%"${__buf#?}"}")
__c=$(LC_CTYPE=C printf "%d" "'${__buf%"${__buf#?}"}"); __c=$((__c > 0 ? __c : 256 + __c))
__buf="${__buf#?}" # Remove the current char from $__buf
;;
esac
Expand Down Expand Up @@ -781,7 +781,7 @@ unpack_line() { # $1: Shell string, $2: Buffer, $3: Ends with EOF?
__buffer=$2
__ends_with_eof=$3
while [ ! -z "$__fgetc_buf" ]; do
__c=$(LC_CTYPE=C printf "%d" "'${__fgetc_buf%"${__fgetc_buf#?}"}")
__c=$(LC_CTYPE=C printf "%d" "'${__fgetc_buf%"${__fgetc_buf#?}"}"); __c=$((__c > 0 ? __c : 256 + __c))
: $((_$__buffer = __c))
__fgetc_buf=${__fgetc_buf#?} # Remove the first character
: $((__buffer += 1)) # Move to the next buffer position
Expand Down
2 changes: 1 addition & 1 deletion examples/compiled/reverse.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ unpack_string() {
# Remove all but first char
__char="${__str%"$__tail"}"
# Convert char to ASCII
__c=$(LC_CTYPE=C printf "%d" "'$__char")
__c=$(LC_CTYPE=C printf "%d" "'$__char"); __c=$((__c > 0 ? __c : 256 + __c))
# Write character to memory
: $((_$__ptr = __c))
# Continue with rest of string
Expand Down
4 changes: 2 additions & 2 deletions examples/compiled/select-file.sh
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ _getchar() {
fi
fi
fi
__c=$(LC_CTYPE=C printf "%d" "'${__stdin_buf%"${__stdin_buf#?}"}")
__c=$(LC_CTYPE=C printf "%d" "'${__stdin_buf%"${__stdin_buf#?}"}"); __c=$((__c > 0 ? __c : 256 + __c))
: $(($1 = __c))
__stdin_buf="${__stdin_buf#?}" # remove the current char from $__stdin_buf
}
Expand Down Expand Up @@ -298,7 +298,7 @@ unpack_string() {
# Remove all but first char
__char="${__str%"$__tail"}"
# Convert char to ASCII
__c=$(LC_CTYPE=C printf "%d" "'$__char")
__c=$(LC_CTYPE=C printf "%d" "'$__char"); __c=$((__c > 0 ? __c : 256 + __c))
# Write character to memory
: $((_$__ptr = __c))
# Continue with rest of string
Expand Down
6 changes: 3 additions & 3 deletions examples/compiled/sha256sum.sh
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ unpack_escaped_string() {
__buf="${__buf#?}" # Remove the current char from $__buf
;;
*)
__c=$(LC_CTYPE=C printf "%d" "'${__buf%"${__buf#?}"}")
__c=$(LC_CTYPE=C printf "%d" "'${__buf%"${__buf#?}"}"); __c=$((__c > 0 ? __c : 256 + __c))
__buf="${__buf#?}" # Remove the current char from $__buf
;;
esac
Expand Down Expand Up @@ -300,7 +300,7 @@ unpack_line() { # $1: Shell string, $2: Buffer, $3: Ends with EOF?
__buffer=$2
__ends_with_eof=$3
while [ ! -z "$__fgetc_buf" ]; do
__c=$(LC_CTYPE=C printf "%d" "'${__fgetc_buf%"${__fgetc_buf#?}"}")
__c=$(LC_CTYPE=C printf "%d" "'${__fgetc_buf%"${__fgetc_buf#?}"}"); __c=$((__c > 0 ? __c : 256 + __c))
: $((_$__buffer = __c))
__fgetc_buf=${__fgetc_buf#?} # Remove the first character
: $((__buffer += 1)) # Move to the next buffer position
Expand Down Expand Up @@ -484,7 +484,7 @@ unpack_string() {
# Remove all but first char
__char="${__str%"$__tail"}"
# Convert char to ASCII
__c=$(LC_CTYPE=C printf "%d" "'$__char")
__c=$(LC_CTYPE=C printf "%d" "'$__char"); __c=$((__c > 0 ? __c : 256 + __c))
# Write character to memory
: $((_$__ptr = __c))
# Continue with rest of string
Expand Down
2 changes: 1 addition & 1 deletion examples/compiled/wc-stdin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ _getchar() {
fi
fi
fi
__c=$(LC_CTYPE=C printf "%d" "'${__stdin_buf%"${__stdin_buf#?}"}")
__c=$(LC_CTYPE=C printf "%d" "'${__stdin_buf%"${__stdin_buf#?}"}"); __c=$((__c > 0 ? __c : 256 + __c))
: $(($1 = __c))
__stdin_buf="${__stdin_buf#?}" # remove the current char from $__stdin_buf
}
Expand Down
4 changes: 2 additions & 2 deletions examples/compiled/wc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ unpack_line() { # $1: Shell string, $2: Buffer, $3: Ends with EOF?
__buffer=$2
__ends_with_eof=$3
while [ ! -z "$__fgetc_buf" ]; do
__c=$(LC_CTYPE=C printf "%d" "'${__fgetc_buf%"${__fgetc_buf#?}"}")
__c=$(LC_CTYPE=C printf "%d" "'${__fgetc_buf%"${__fgetc_buf#?}"}"); __c=$((__c > 0 ? __c : 256 + __c))
: $((_$__buffer = __c))
__fgetc_buf=${__fgetc_buf#?} # Remove the first character
: $((__buffer += 1)) # Move to the next buffer position
Expand Down Expand Up @@ -296,7 +296,7 @@ unpack_string() {
# Remove all but first char
__char="${__str%"$__tail"}"
# Convert char to ASCII
__c=$(LC_CTYPE=C printf "%d" "'$__char")
__c=$(LC_CTYPE=C printf "%d" "'$__char"); __c=$((__c > 0 ? __c : 256 + __c))
# Write character to memory
: $((_$__ptr = __c))
# Continue with rest of string
Expand Down
2 changes: 1 addition & 1 deletion examples/compiled/welcome.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ _getchar() {
fi
fi
fi
__c=$(LC_CTYPE=C printf "%d" "'${__stdin_buf%"${__stdin_buf#?}"}")
__c=$(LC_CTYPE=C printf "%d" "'${__stdin_buf%"${__stdin_buf#?}"}"); __c=$((__c > 0 ? __c : 256 + __c))
: $(($1 = __c))
__stdin_buf="${__stdin_buf#?}" # remove the current char from $__stdin_buf
}
Expand Down

0 comments on commit 65a64f2

Please sign in to comment.