Re: [PATCH v4 1/4] btrfs-progs: utils: Introduce function to escape characters

2016-11-09 Thread David Sterba
On Tue, Nov 08, 2016 at 08:57:52AM +0800, Qu Wenruo wrote: > And further more. > > The new string escaping is screwing up original output. > > Operation lile mkfile lacks the final '\n'. > String over the width will lack the ending ' ' to seperate later > key=value pairs. Oh right, that's the s

Re: [PATCH v4 1/4] btrfs-progs: utils: Introduce function to escape characters

2016-11-09 Thread David Sterba
On Tue, Nov 08, 2016 at 08:33:25AM +0800, Qu Wenruo wrote: > While still some small comment. > + if (!isprint(c)) { > + printf("\\%c%c%c", > + '0' + ((c & 0300) >> 6), > +

Re: [PATCH v4 1/4] btrfs-progs: utils: Introduce function to escape characters

2016-11-07 Thread Qu Wenruo
At 11/07/2016 06:20 PM, David Sterba wrote: On Thu, Nov 03, 2016 at 12:07:31PM +0800, Qu Wenruo wrote: Introduce new function, escape_string_inplace(), to escape specified characters in place. Signed-off-by: Qu Wenruo --- utils.c | 24 utils.h | 14 ++ 2

Re: [PATCH v4 1/4] btrfs-progs: utils: Introduce function to escape characters

2016-11-07 Thread Qu Wenruo
At 11/07/2016 06:20 PM, David Sterba wrote: On Thu, Nov 03, 2016 at 12:07:31PM +0800, Qu Wenruo wrote: Introduce new function, escape_string_inplace(), to escape specified characters in place. Signed-off-by: Qu Wenruo --- utils.c | 24 utils.h | 14 ++ 2

Re: [PATCH v4 1/4] btrfs-progs: utils: Introduce function to escape characters

2016-11-07 Thread David Sterba
On Thu, Nov 03, 2016 at 12:07:31PM +0800, Qu Wenruo wrote: > Introduce new function, escape_string_inplace(), to escape specified > characters in place. > > Signed-off-by: Qu Wenruo > --- > utils.c | 24 > utils.h | 14 ++ > 2 files changed, 38 insertions(+)

[PATCH v4 1/4] btrfs-progs: utils: Introduce function to escape characters

2016-11-02 Thread Qu Wenruo
Introduce new function, escape_string_inplace(), to escape specified characters in place. Signed-off-by: Qu Wenruo --- utils.c | 24 utils.h | 14 ++ 2 files changed, 38 insertions(+) diff --git a/utils.c b/utils.c index 3f54245..3c50d84 100644 --- a/utils.c