diff options
author | ache <ache@FreeBSD.org> | 1995-01-17 22:55:59 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 1995-01-17 22:55:59 +0000 |
commit | eb022aca1e2e3c2aa6fe4143574d0e59c8b47073 (patch) | |
tree | 83d4b235db557b7afc87201c716ad9fd6983b828 /bin/dd | |
parent | 9771a4667afc58db0d31fe130281e9dca87a3a59 (diff) | |
download | FreeBSD-src-eb022aca1e2e3c2aa6fe4143574d0e59c8b47073.zip FreeBSD-src-eb022aca1e2e3c2aa6fe4143574d0e59c8b47073.tar.gz |
Make conv=[lu]case works with localized ctype (8bit)
Diffstat (limited to 'bin/dd')
-rw-r--r-- | bin/dd/dd.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/bin/dd/dd.c b/bin/dd/dd.c index dbef8c1..dc55aed 100644 --- a/bin/dd/dd.c +++ b/bin/dd/dd.c @@ -34,7 +34,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ + * $Id: dd.c,v 1.2 1994/09/24 02:54:52 davidg Exp $ */ #ifndef lint @@ -195,8 +195,18 @@ setup() if (islower(cnt)) ctab[cnt] = ctab[toupper(cnt)]; } - else + else { ctab = ddflags & C_LCASE ? u2l : l2u; + if (ddflags & C_LCASE) { + for (cnt = 0; cnt < 0377; ++cnt) + if (isupper(cnt)) + ctab[cnt] = tolower(cnt); + } else { + for (cnt = 0; cnt < 0377; ++cnt) + if (islower(cnt)) + ctab[cnt] = toupper(cnt); + } + } (void)time(&st.start); /* Statistics timestamp. */ } |