[vox-tech] Wierd, bizarre file problem

Ken Bloom vox-tech@lists.lugod.org
Sun, 12 Jan 2003 01:18:58 -0800


I'm writing a program using QT3 out of debian unstable, and am finding
an excessively wierd problem:

I have the following function that I call from the initialization of the
main form of my program, and I do not write to stdout anywhere else in
the whole program.

QValueList<location> parseconfigfile()
{
    QValueList<location> retval;
    QString filename(std::getenv("HOME")); filename+="/.zmanrc";
    QTextIStream infile(&filename);
    QString line;
    while((line=infile.readLine())!=NULL)
    {
        std::cout << line << endl;
        line.simplifyWhiteSpace();
        if(line.length()>0 && !line.startsWith("#"))
        {
            QStringList linetokenized=QStringList::split(" ",line);
            location result;
            result.name=linetokenized[0];
            result.latitude=linetokenized[1].toDouble();
            result.longitude=linetokenized[2].toDouble();
            result.offset=linetokenized[3].toDouble();
            result.observesdst=(linetokenized.size()==5)&&
                                linetokenized[4]=="dst";
            retval.insert(retval.end(),result);
        }
    }
    
    return retval;
}

When I run the program, I get the following output.

[bloom@kabloom ~/qtzmanim]$ ./qtzmanim 2>-          
/home/bloom/.zmanrc

I can be dead certain that that pathname isn't anywhere in the file I'm
reading from:
[bloom@kabloom ~/qtzmanim]$ cat /home/bloom/.zmanrc
davis                   38.6    -121.7  -8      dst
sunnyvale               37.4    -122.0  -8      dst
san_jose                37.3    -121.9  -8      dst
vallejo                 38.1    -122.2  -8      dst
sacramento              38.6    -121.5  -8      dst
san_francisco   37.8    -122.4  -8      dst


What's going on here?

(using libqt3 and libqt3-dev 3.1.1+cvs.20021220-1)