Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix awk regex #1973

Merged
merged 1 commit into from
Oct 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions ethd
Original file line number Diff line number Diff line change
Expand Up @@ -1052,7 +1052,7 @@ __get_value_from_env() {
# Match a quoted single-line value
$0 ~ "^[ \t]*"var"=\"[^\"]*\"[ \t]*$" {
gsub("^[ \t]*"var"=\"", "")
gsub(/\"[ \t]*$/, "", $0)
gsub(/"[ \t]*$/, "", $0)
__value = "\"" $0 "\""
__found = 1
exit
Expand All @@ -1067,14 +1067,14 @@ __get_value_from_env() {
}

# Continue collecting lines for a multi-line value
__found && !/\"[ \t]*$/ {
__found && !/"[ \t]*$/ {
__value = __value $0 "\n"
next
}

# End of a multi-line value (with closing quote)
__found && /\"[ \t]*$/ {
gsub(/[ \t]*\"[ \t]*$/, "")
__found && /"[ \t]*$/ {
gsub(/[ \t]*"[ \t]*$/, "")
__value = __value $0 "\""
__found = 1
exit
Expand Down Expand Up @@ -1134,12 +1134,12 @@ __update_value_in_env() {
}

# Continue to skip lines in a multi-line block if multi_line is true
multi_line && !/\"[ \t]*$/ {
multi_line && !/"[ \t]*$/ {
next
}

# If we reach the end of a multi-line value, reset flags
multi_line && /\"[ \t]*$/ {
multi_line && /"[ \t]*$/ {
in_block = 0
multi_line = 0
next
Expand Down