Opened 14 years ago
Closed 14 years ago
#3213 closed defect (fixed)
ESRI ArcInfo ASCII driver not Mac-compatible
Reported by: | rayg | Owned by: | chaitanya |
---|---|---|---|
Priority: | normal | Milestone: | 1.7.0 |
Component: | GDAL_Raster | Version: | 1.6.2 |
Severity: | normal | Keywords: | AAIGRID |
Cc: | warmerdam |
Description
Near line 530 in frmts/aaigriddataset.cpp, function AAIGDataset::Open, this code:
if( poOpenInfo->pabyHeader[i-1] == '\n'
poOpenInfo->pabyHeader[i-2] == '\n' ) {
if( !isalpha(poOpenInfo->pabyHeader[i]) ) {
nStartOfData = i; /* Beginning of real data found. */ break;
}
}
fails to find the start of data if the input file uses only carriage return (0x0D) line termination, because it assumes that 0x0A characters are present. The if() statement should read:
if( poOpenInfo->pabyHeader[i-1] == '\n'
poOpenInfo->pabyHeader[i-2] == '\n' poOpenInfo->pabyHeader[i-1] == '\r' poOpenInfo->pabyHeader[i-2] == '\r' )
Change History (4)
comment:1 by , 14 years ago
Cc: | added |
---|---|
Keywords: | AAIGRID added |
Milestone: | → 1.7.0 |
Owner: | changed from | to
comment:2 by , 14 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Applied the patch in trunk (r17973).
follow-up: 4 comment:3 by , 14 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Chaitanya,
the patch is incorrect in its current form. It breaks several test cases of autotest on all platforms. See http://buildbot.osgeo.org:8500/builders/telascience-full/builds/97/steps/test/logs/stdio (it would be good if you check that the autotest suite still passes before commiting code)
It fails when the line terminator is 0x0d 0x0a, which is the case of pixel_per_line.asc for example (if i points to 0x0a, pabyHeader[i-1] == 0x0d and isalpha(poOpenInfo->pabyHeader[i]) is false...). Once you get it fixed, it would be good also to add a test with a file whose line terminator = 0x0d (the 2 other cases are already tested)
comment:4 by , 14 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Chaitanya,
Please review and apply in trunk.