Show
Ignore:
Timestamp:
09/09/10 13:03:26 (21 months ago)
Author:
westram
Message:
  • report more information about broken configurations
  • GBT_commit_rename_session did NEVER report error (since [2])
    • added __ATTR__USERESULT
  • forward error in AWTC_pars_names (and abort complete rename)
  • this fixes the bug with noticable broken configs after merge/rename
    • cause of bug: the config parser used inside ABRDB is much more picky than the one used in NTREE (needs to be DRYed)
    • no idea when this bug was introduced (maybe by introduction of GBT_config_parser in [3824]) and why it popped up now
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/ARBDB/ad_config.cxx

    r6421 r6811  
    195195        } 
    196196 
    197         switch (item->type) { 
    198             case CI_CLOSE_GROUP: 
    199                 pos += 2; 
    200                 break; 
    201  
    202             case CI_UNKNOWN: 
    203                 error = GBS_global_string_copy("Unknown flag '%c'", label); 
    204                 break; 
    205  
    206             default: { 
    207                 const char *start_of_name = str+pos+2; 
    208                 const char *behind_name   = strchr(start_of_name, '\1'); 
    209  
    210                 if (!behind_name) behind_name = strchr(start_of_name, '\0'); // eos 
    211                 gb_assert(behind_name); 
    212  
    213                 item->name = (char*)GB_calloc(1, behind_name-start_of_name+1); 
    214                 memcpy(item->name, start_of_name, behind_name-start_of_name); 
    215                 pos       = behind_name-str; 
    216                 break; 
     197        if (item->type == CI_CLOSE_GROUP) { 
     198            pos += 2; 
     199        } 
     200        else { 
     201            const char *start_of_name = str+pos+2; 
     202            const char *behind_name   = strchr(start_of_name, '\1'); 
     203 
     204            if (!behind_name) behind_name = strchr(start_of_name, '\0'); // eos 
     205            gb_assert(behind_name); 
     206 
     207            char *data = GB_strpartdup(start_of_name, behind_name-1); 
     208            if (item->type == CI_UNKNOWN) { 
     209                error = GBS_global_string_copy("Unknown flag '%c' (followed by '%s')", label, data); 
     210                free(data); 
     211            } 
     212            else { 
     213                item->name = data; 
     214                pos        = behind_name-str; 
    217215            } 
    218216        }