Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Printf builtin missing v flag support
- X-seq: zsh-workers 37485
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: Printf builtin missing v flag support
- Date: Fri, 1 Jan 2016 20:17:24 -0800
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version:content-type; bh=q0vhGDPEO4xUCejCPxtSI+Yy9WIuvwhpMrfQpF/YglE=; b=S/XZO3b7sx6t6YzlxLQJAZfgG1Ccg3uX9h+05ndYusV6myyDrKxqQpuoK5iG7KzOWg eCjtpMq3f6/ZwNJH1Iq78CXx+R2eZK+CnOZSlGj4hfA5Hr+OtHSZgFJWuV/dF4imVlsP caNpzDsI5x8VG4q4cVgZ/jcfN4vL2vqGECP+OgJspI155N4WeZM4B901VKNxUDwfRUIG VoNnu4HZert8/NzPf62li1mKxjtFpfi1Gyk9SHQ+h4F8rrTRtuyQVsHrLBaoAk8X6L9p Yar/N0RDOJXxO70YsFqBoYRoNwsXrpu64+7fzRQyR/KuNLWxQlbc/Y7s1AVaQMi2HXOW sBaw==
- In-reply-to: <CAKc7PVDsXof4TFRvtY15qThTEPqLz6NiSeL6dsKxqGXyK2aVeg@mail.gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <068ca8f5-315b-444c-b281-5f183e1daa8c@email.android.com> <151231104858.ZM24513@torch.brasslantern.com> <CAKc7PVCXaicToQHdgaqnOmoqHjqQLxUXQSUrBx=fjs9JH2USKQ@mail.gmail.com> <160101135224.ZM10746@torch.brasslantern.com> <CAKc7PVDsXof4TFRvtY15qThTEPqLz6NiSeL6dsKxqGXyK2aVeg@mail.gmail.com>
On Jan 1, 11:12pm, Sebastian Gniazdowski wrote:
} Subject: Re: Printf builtin missing v flag support
}
} On 1 January 2016 at 22:52, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
} >
} > To make it work with -x, -X, -C, etc. would require moving the memstream
} > code to the top of the function, plus some related fiddling around later.
}
} Could you implement that? The move of memstream code seems like a
} cleanup, print would have full control of whether do memstream or not.
I looked at it, but it's more messy than I thought, because the printf
branch keeps a running count of the number of bytes printed, which is
then needed for handling the result. No sub-part of the print branch
maintains that byte count, so a lot of fiddly little changes are needed.
Also the print branch does some extra work to detect write errors on
redirection -- which it looks like might actually be buggy in the
-z/-s case when HAVE_OPEN_MEMSTREAM is not defined, and which have to
be rewritten for the -v case -- so this is not going to happen quickly.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author