diff options
author | ache <ache@FreeBSD.org> | 2002-03-25 15:49:07 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 2002-03-25 15:49:07 +0000 |
commit | e87761a7cf3fb916d5d1d99a18d036a6714ca2e8 (patch) | |
tree | 1c4ba964ef4014d369638e44160dd992c385ad56 | |
parent | 8624a5ead1a856ccc416f35a7fd7c134624b3bdc (diff) | |
download | FreeBSD-src-e87761a7cf3fb916d5d1d99a18d036a6714ca2e8.zip FreeBSD-src-e87761a7cf3fb916d5d1d99a18d036a6714ca2e8.tar.gz |
Fix the case when record separator is 'Z' letter
Sense high spaces for -d option too
-rw-r--r-- | usr.bin/sort/init.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/usr.bin/sort/init.c b/usr.bin/sort/init.c index 9bcc1d2..966d856 100644 --- a/usr.bin/sort/init.c +++ b/usr.bin/sort/init.c @@ -312,7 +312,7 @@ settables(gflags) if (islower(i)) { Ftable[i] = Ftable[toupper(i)]; RFtable[i] = RFtable[toupper(i)]; - } else if (REC_D>= 'A' && REC_D < 'Z' && i < 'a' && i > REC_D) { + } else if (REC_D >= 'A' && REC_D <= 'Z' && i < 'a' && i > REC_D) { Ftable[i] = i + 1; RFtable[i] = Rascii[i] - 1; } else { @@ -326,7 +326,11 @@ settables(gflags) else itable[i] = 0; - if (i == '\n' || i == '\t' || i == ' ' || isalnum(i)) + if ( isalnum(i) + || ( isspace(i) + && (i == '\n' || i == '\t' || isprint(i)) + ) + ) dtable[i] = 1; else dtable[i] = 0; |