mirror of
https://github.com/Unidata/netcdf-c.git
synced 2024-11-27 07:30:33 +08:00
fix bug in reading a file url (needs to signal binary if possible)
This commit is contained in:
parent
64a78ab239
commit
29d3fe7d51
@ -341,7 +341,7 @@ static char* decodelist =
|
||||
char*
|
||||
dapdecode(DAPlexstate* lexstate, char* name)
|
||||
{
|
||||
char* decoded;
|
||||
char* decoded = NULL;
|
||||
#ifdef DECODE_IDENTIFIERS
|
||||
decoded = ocuridecode(name);
|
||||
#else
|
||||
|
@ -409,17 +409,10 @@ ocextractddsinmemory(OCstate* state, OCtree* tree, OCflags flags)
|
||||
OCerror stat = OC_NOERR;
|
||||
size_t ddslen, bod, bodfound;
|
||||
/* Read until we find the separator (or EOF)*/
|
||||
#ifdef OCDEBUG
|
||||
fprintf(stderr,"ocextractddsinmemory:\n");
|
||||
#endif
|
||||
bodfound = ocfindbod(state->packet,&bod,&ddslen);
|
||||
if(!bodfound) {/* No BOD; pretend */
|
||||
bod = tree->data.bod;
|
||||
ddslen = tree->data.datasize;
|
||||
#ifdef OCDEBUG
|
||||
fprintf(stderr,"missing bod: ddslen=%lu bod=%lu\n",
|
||||
(unsigned long)ddslen,(unsigned long)bod);
|
||||
#endif
|
||||
}
|
||||
tree->data.bod = bod;
|
||||
tree->data.ddslen = ddslen;
|
||||
@ -452,9 +445,6 @@ ocextractddsinfile(OCstate* state, OCtree* tree, OCflags flags)
|
||||
OCerror stat = OC_NOERR;
|
||||
size_t ddslen, bod, bodfound;
|
||||
|
||||
#ifdef OCDEBUG
|
||||
fprintf(stderr,"ocextractddsinfile:\n");
|
||||
#endif
|
||||
/* Read until we find the separator (or EOF)*/
|
||||
ocbytesclear(state->packet);
|
||||
rewind(tree->data.file);
|
||||
|
@ -134,10 +134,6 @@ ocfindbod(OCbytes* buffer, size_t* bodp, size_t* ddslenp)
|
||||
*ddslenp = i;
|
||||
i += tlen;
|
||||
*bodp = i;
|
||||
#ifdef OCDEBUG
|
||||
fprintf(stderr,"findbod: ddslen=%lu bod=%lu\n",
|
||||
(unsigned long)*ddslenp,(unsigned long)*bodp);
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user