printf("charset %s\n", m->charset); for(aptr = m->aliases; aptr; aptr = aptr->next) { if(strcmp(aptr->charset, m->charset)) printf("alias %s %s\n", aptr->charset, m->charset); }
int main(int argc, const char *argv[]){  FILE *fp;  CHARMAP *m;  int i;  char buffer[1024];    basedir = safe_strdup(argv[1]);    for(i = 2; i < argc; i++)  {    if(!strcmp(argv[i], "-"))      fp = stdin;    else if(!(fp = fopen(argv[i], "r")))    {      perror(argv[i]);      continue;    }        if((m = parse_charmap_header(fp, argv[i])))      parse_charmap_body(fp, m, argv[i]);        fclose(fp);        if(m && m->charset && m->is_valid)    {      snprintf(buffer, sizeof(buffer), "%s%s%s",	       basedir ? basedir : "", basedir ? "/" : "",	       m->charset);            if((fp = fopen(buffer, "w")))      {	printf("%s\n", m->charset);	write_charmap(fp, m);	fclose(fp);      }      else      {	perror(buffer);      }    }    charmap_free(&m);  }  return 0;}