소스 검색

Don't (mis)use tr/// to remove non-printables

Turns out tr/// *does not support POSIX classes* at all.  This command
could not have ever worked.  (schroedinbug).
Alois Mahdal 5 년 전
부모
커밋
b1f3060143
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1
    1
      src/include-sh/coerce.sh

+ 1
- 1
src/include-sh/coerce.sh 파일 보기

@@ -27,7 +27,7 @@ coerce__noctl() {
27 27
     #
28 28
     # Remove non-printable characters
29 29
     #
30
-    perl -CS -Mutf8 -pe 'tr|[:graph:]\n\t ||c;'
30
+    perl -CS -Mutf8 -pe "s|[^[:graph:] \t\n]||g"
31 31
 }
32 32
 
33 33
 coerce__nofdraw() {