Commit ee5a241b authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Merge branch 'develop' of git.mpimet.mpg.de:cdo into develop

parents 1c7169bd b095a2bc
......@@ -1406,3 +1406,20 @@ void operatorPrintList(bool print_no_output) {
std::cout << str << std::endl;
}
}
bool is_alias(char * operatorName)
{
return (aliases.find(std::string(operatorName)) != aliases.end());
}
void get_original(char * operatorName)
{
if(is_alias(operatorName)){
std::string opName = aliases[std::string(operatorName)];
operatorName = (char*)realloc(operatorName, opName.size());
strcpy(operatorName, opName.c_str());
}
else{
Error("%s is not an alias", operatorName);
}
}
......@@ -71,6 +71,8 @@ int operatorStreamNumber(const char *operatorName);
void operatorPrintAll(void);
void operatorPrintList(bool print_no_output);
bool is_alias(char * operatorName);
void get_original(char* operatorName);
#ifdef CUSTOM_MODULES
void load_custom_module(std::string path);
void load_custom_modules(std::string folder_path);
......
......@@ -945,10 +945,11 @@ int cdoOperatorID(void)
if ( Process[processID].noper > 0 )
{
for ( operID = 0; operID < Process[processID].noper; operID++ )
for ( operID = 0; operID < Process[processID].noper; operID++ ){
if ( Process[processID].oper[operID].name )
if ( strcmp(Process[processID].operatorName, Process[processID].oper[operID].name) == 0 ) break;
}
if ( operID == Process[processID].noper )
cdoAbort("Operator not callable by this name!");
}
......
......@@ -238,10 +238,11 @@ const char *getOperatorName(const char *operatorArg)
}
/* return operatorName; */
std::string opName = aliases[std::string(operatorName)];
memcpy(operatorName,opName.c_str(),opName.size() );
return operatorName;
if(is_alias(operatorName))
{
get_original(operatorName);
}
return operatorName;
}
......
Markdown is supported
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