Show
Ignore:
Timestamp:
1999-08-23 07:53:44 (9 years ago)
Author:
Thomas Roessler <roessler@…>
Branch:
HEAD
Message:

Don't delete symbol -> character code mappings. Character sets may
define multiple symbols. :-(

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • charset.c

    r991 r1225  
    432432          hash_insert (cs->symb_to_repr, cd->symbol, cd, 0); 
    433433 
    434           if (cs->description[cd->repr]) 
    435           { 
    436             hash_delete (cs->symb_to_repr, cs->description[cd->repr]->symbol, cs->description[cd->repr], NULL); 
    437             chardesc_free (&cs->description[cd->repr]); 
    438           } 
    439           else 
     434          /* note: we intentionally leak some memory here. */ 
     435          if (!cs->description[cd->repr]) 
    440436            cs->u_symb++; 
    441437 
     
    456452          cs->n_symb = new_size; 
    457453        } 
     454 
    458455        hash_delete (cs->symb_to_repr, cd->symbol, NULL, NULL); 
    459456        hash_insert (cs->symb_to_repr, cd->symbol, cd, 0); 
     457 
    460458        cs->description[cs->u_symb++] = cd; 
    461459        cd = NULL; 
    462460      } 
    463461    } 
     462 
    464463    if (cd) 
    465464    { 
     
    504503  key->repr = repr; 
    505504  key->symbol = "<unknown>"; /* otherwise, the 
    506                              * debug code may  
    507                              * segfault. ouch. 
    508                              */ 
     505                              * debug code may  
     506                              * segfault. ouch. 
     507                              */ 
    509508 
    510509  r = bsearch (&key, cs->description, cs->u_symb,