On 12/01/2014 10:55 PM, KO Myung-Hun wrote:
> Subject: [PATCH] git-version-gen: do not print new line characters
>
> * build-aux/git-version-gen: Use printf instead of echo and tr.
This commit message says what, but lacks why; the next reader might
appreciate knowing that some versions of 'echo'
Hi/2.
Paul Eggert wrote:
> Sorry, I forgot to CC: this one to you.
>
>
> Forwarded Message
> Subject: Re: [PATCH 03/21] git-version-gen: remove CR as well
> Date: Sun, 30 Nov 2014 08:41:03 -0800
> From: Paul Eggert
> Organization: UCLA Computer Scie
On 11/29/2014 09:20 PM, KO Myung-Hun wrote:
> On OS/2, a new line consists of CR and LF.
>
> * build-aux/git-version-gen: Remove CR as well.
> ---
> build-aux/git-version-gen | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/build-aux/git-version-gen b/build-aux/git-vers
KO Myung-Hun wrote:
+echo "$v" | tr -d "$cr$nl"
How about this instead?
printf '%s' "$v"
This avoids the need for cr and for tr, which is simpler and a bit faster. The
script is already using printf so this shouldn't be a portability issue.
On OS/2, a new line consists of CR and LF.
* build-aux/git-version-gen: Remove CR as well.
---
build-aux/git-version-gen | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/build-aux/git-version-gen b/build-aux/git-version-gen
index 47d6576..77fb2ad 100755
--- a/build-aux/git-ve