"Ivan E. Moore II" wrote:
> On Sat, Dec 01, 2001 at 12:59:27PM +0100, Malte Cornils wrote:
> > Another thing that's not exactly well-working, although probably not
> > a packaging issue, is that kdf always crashes when LANG is set to
> > something else than English/C. For example,
> 
> yes..this is a known problem which has existed for quite some time and
> was reported to KDE several months ago.

Well, it rather bothers me so I had to try to create a patch for the
problem. I'm probably doing a million things wrong but it works for
me (tm). Can anyone have a look at it, fix it up so it's non-ugly (I
don't really know C++, and it shows) and apply it in the Debian
packages and/or upstream?

Yours Malte #8-)
diff -Naur kdeutils-2.2.2.old/kdf/disklist.cpp kdeutils-2.2.2/kdf/disklist.cpp
--- kdeutils-2.2.2.old/kdf/disklist.cpp Tue Dec 26 16:47:54 2000
+++ kdeutils-2.2.2/kdf/disklist.cpp     Sat Dec  1 16:01:50 2001
@@ -24,6 +24,7 @@
  */
 
 #include <math.h>
+#include <stdlib.h>
 
 #include <qstring.h>
 #include <qfile.h>
@@ -73,6 +74,10 @@
 
 if (NO_FS_TYPE)
   kdDebug() << "df gives no FS_TYPE" << endl;
+
+   // to prevent crashes, set LC_ALL so that df gives parseable
+   // English output
+   setenv("LC_ALL", "C", 1);
 
    disks = new Disks;
    disks->setAutoDelete(TRUE);

Reply via email to