Skip to content

Commit

Permalink
keep original string builder name.
Browse files Browse the repository at this point in the history
  • Loading branch information
cfogrady committed Nov 5, 2024
1 parent 18de442 commit edb5bbc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions expand/expand.go
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ func (cfg *Config) wordField(wps []syntax.WordPart, ql quoteLevel) ([]fieldPart,
}
}
if ql == quoteDouble && strings.Contains(s, "\\") {
buf := cfg.strBuilder()
sb := cfg.strBuilder()
for i := 0; i < len(s); i++ {
b := s[i]
if b == '\\' && i+1 < len(s) {
Expand All @@ -513,9 +513,9 @@ func (cfg *Config) wordField(wps []syntax.WordPart, ql quoteLevel) ([]fieldPart,
b = s[i] // write the special char, skipping the backslash
}
}
buf.WriteByte(b)
sb.WriteByte(b)
}
s = buf.String()
s = sb.String()
}
if i := strings.IndexByte(s, '\x00'); i >= 0 {
s = s[:i]
Expand Down

0 comments on commit edb5bbc

Please sign in to comment.