Bug#1024811: Re: Bug#1024811: linux: /proc/[pid]/stat unparsable

2022-12-22 Thread Thorsten Glaser
Donald Buczek dixit: >No, Escaping would break existing programs which parse the line by >searching for the ')' from the right. Huh? No! The format is "(" + string + ") " after all, and only the string part would get escaped. The only visible change would be that programs containing a whitespac

Bug#1024811: Re: Bug#1024811: linux: /proc/[pid]/stat unparsable

2022-12-22 Thread Donald Buczek
On 12/22/22 1:53 AM, Thorsten Glaser wrote: > On Sat, 26 Nov 2022, Alexey Dobriyan wrote: > >> /proc never escaped "comm" field of /proc/*/stat. > > Yes, that’s precisely the bug. > >> To parse /proc/*/stat reliably, search for '(' from the beginning, then >> for ')' backwards. Everything in bet