Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 01 Apr 1996 13:51:32 +0200
From:      Martin Butkus <mb@malibu.ts.rz.tu-bs.de>
To:        freebsd-stable@freebsd.org
Subject:   fmt eats umlauts
Message-ID:  <199604011151.NAA00736@malibu.ts.rz.tu-bs.de>

next in thread | raw e-mail | index | archive | help
Hi,

I've found a bug in /usr/bin/fmt. It ignores the locale
set by LANG so that isprint() returns false for all the special
characters such as german umlauts. This results in such characters
being ommited in the output of fmt.

This patch (applied to -stable patchlevel 62) fixes the problem:

--- begin ---
*** /usr/src/usr.bin/fmt/fmt.c  Tue May 30 08:30:18 1995
--- ./fmt.c     Mon Apr  1 13:44:35 1996
***************
*** 43,48 ****
--- 43,49 ----
  
  #include <stdio.h>
  #include <ctype.h>
+ #include <locale.h>
  
  /*
   * fmt -- format the concatenation of input files or standard input
***************
*** 84,89 ****
--- 85,91 ----
        register int errs = 0;
        int number;             /* LIZ@UOM 6/18/85 */
  
+       (void)setlocale(LC_ALL,"");
        goal_length = GOAL_LENGTH;
        max_length = MAX_LENGTH;
        setout();
--- end ---

Maybe it should be integrated into -stable. Comments?

--
Martin Butkus					>>> Live long and prosper. <<<
Phone/Fax: +49.5331.298710
Am Stadtwege 10, 38304 Wolfenbuettel, Germany	



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199604011151.NAA00736>