From: Phillip Wood Date: Mon, 30 Nov 2026 14:51:08 GMT Subject: Re: [RFC PATCH] quote: make sq_quote_buf_pretty() prettier Message-ID: <030b99fb-1176-4514-9787-fcd733649eb7@gmail.com> In-Reply-To: Hi Nahid On 27/11/2026 18:25, Nahid hasan Sagor wrote: >> + /* '~' is only special if it is the first character */ >> + if (*p == '~') { >> + quote_it = true; >> + p++; >> } > > I may be misreading, but I think a leading '~' gets lost after the > 'p++', so it never gets copied by strbuf_add(dst, p, q - p) later. That > would make "~foo" come out as "'foo'". You're right - good catch. Junio has pointed out some other problems with the handling of '~' as well so I'll rework this. Thanks Phillip