Commit 4d9e7157 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

parse_buffer_to_pml: removed ':' from listkeyX string.

parent 100a03ff
......@@ -279,12 +279,16 @@ void apply_cmor_table(const char *filename, int nvars, int vlistID2, var_t *vars
}
else
{
if ( cdoVerbose ) cdoPrint("Key >%s< not supported!", key);
if ( cdoVerbose ) cdoPrint("Attribute %s:%s not supported!", varname, key);
}
}
if ( lvalid_min && lvalid_max ) vars[varID].checkvalid = true;
}
else
{
cdoPrint("Variable %s not found!", varname);
}
}
list_destroy(pml);
......
......@@ -73,7 +73,10 @@ char *getElementValue(char *pline)
{
while ( isspace((int) *pline) ) pline++;
size_t len = strlen(pline);
while ( isspace((int) *(pline+len-1)) && len ) { *(pline+len-1) = 0; len--;}
if ( *pline != '"' && *pline != '\'' )
for ( size_t i = 1; i < len; ++i )
if ( pline[i] == '!' ) { pline[i] = 0; len = i; break; }
while ( isspace((int) *(pline+len-1)) && len ) { *(pline+len-1) = 0; len--; }
return pline;
}
......@@ -84,8 +87,8 @@ void parse_buffer_to_pml(list_t *pml, size_t buffersize, char *buffer)
char line[4096];
char name[256];
char *pline;
char listkey1[] = "axis_entry:";
char listkey2[] = "variable_entry:";
char listkey1[] = "axis_entry";
char listkey2[] = "variable_entry";
int linenumber = 0;
int listtype = 0;
list_t *kvl = NULL;
......@@ -345,8 +348,10 @@ list_t *cdo_parse_cmor_file(const char *filename)
if ( buffer[0] == '{' )
parse_json_buffer_to_pml(pml, filesize, buffer);
else
else if ( strncmp(buffer, "table_id:", 9) == 0 )
parse_buffer_to_pml(pml, filesize, buffer);
else
cdoAbort("Invalid CMOR table (file: %s)!", filename);
Free(buffer);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment