Re: [PATCH] Extend sample pre-commit hook to check for non ascii filenames
- From
Johannes Sixt <j.sixt@viscovery.net>
- Date
- May 18, 2009, 12:04 UTC
- Message-ID
- <4A114EB8.60609@viscovery.net>
- In-Reply-To
- <20090518115002.GA3374@heiko-voigts-macbook.local>
Heiko Voigt schrieb:
> Are there any problems with '\0' and tr other than swallowing of it.
I can't tell. But the commits ae90e16..aab0abf are interesting to study in w.r.t. portability.
Show 6 quoted lines
> In > case not I would just change > > tr "\0" "\n" > to > tr -d '\0'
In which case I'd suggest that you call tr only once, in isascii():
tr -d '[ -~]\0'
-- Hannes