[GRASS5] [5.0][PATCH]pg.in.dbf/dbfopen.c: fix weird filenames acrobatics

Thierry Laronde tlaronde at polynum.org
Sun Sep 14 10:54:23 EDT 2003


Hello,

In dbfopen.c, the filename of the DBF file supposed to be opened was
subject of extension changes, `strcmp' being used as if it was a
matching function returning 0 if failed or not zero on success. And indeed
this is almost exactly the contrary.
Furthermore, the combination of two conditions made the first test succeeds
in all cases, transforming every extension in ".dbf".

Last but not least, _without renaming or copying the file_ this was this
modified version of the filename that was given to `fopen' resulting in a
failure in every case except when the change to ".dbf" was a null one, that
is when the filename was already ending with ".dbf".

The patch removes the offending stuff.

Cheers,

PS0: please don't be upset by the tone of the comments: I have the very
same with my own errors, and I make a lot of these. This is just aimed to
be matter of fact and descriptive.

PS1: I'm still working on the 5.0 [5.3] branch since I have installed it
at my work and have some job to be done without changing everything at the
moment.

PS2: I have downloaded 5.7 and started to look at the new vector format (and
will ask some questions/give some suggestions hopefully in the next days).

PS3: to avoid problem, when I work on GRASS by itself, I make it during my
spare time to be sure that I own all the copyrights of my work and can 
give/share them with the project (I'm not officially hired for doing 
programming, so during my spare time I'm sure my boss can claim strictly 
nothing). This can explain why I will make apparitions only from time to
time).
-- 
Thierry Laronde (Alceste) <tlaronde at polynum.org>
Key fingerprint = 0FF7 E906 FBAF FE95 FD89  250D 52B1 AE95 6006 F40C
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch-src::src.garden::grass.postgresql::pg.in.dbf::dbfopen.c
Type: text/x-csrc
Size: 2047 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/grass-dev/attachments/20030914/ac356481/dbfopen.bin


More information about the grass-dev mailing list