do fgets (junk, sizeof junk, fp); while (strchr (junk, '\n') == NULL);
while (fgets (junk, sizeof junk, fp) != NULL && strchr (junk, '\n') == NULL) continue;
write_charmaps (void){  void *all_data = NULL;  DIR *dir;  struct dirent *dirent;  dir = opendir (CHARMAP_PATH);  if (dir == NULL)    {      error (1, errno, gettext ("cannot read character map directory `%s'"),	     CHARMAP_PATH);      return;    }  /* Now we can look for all files in the directory.  */  while ((dirent = readdir (dir)) != NULL)    if (strcmp (dirent->d_name, ".") != 0	&& strcmp (dirent->d_name, "..") != 0)      {	char *buf = NULL;	mode_t mode;#ifdef _DIRENT_HAVE_D_TYPE	if (dirent->d_type != DT_UNKNOWN)	  mode = DTTOIF (dirent->d_type);	else#endif	  {	    struct stat st;	    buf = alloca (sizeof (CHARMAP_PATH) + strlen (dirent->d_name) + 1);	    stpcpy (stpcpy (stpcpy (buf, CHARMAP_PATH), "/"), dirent->d_name);	    if (stat (buf, &st) < 0)	      continue;	    mode = st.st_mode;	  }	if (S_ISREG (mode))	  {	    FILE *fp;	    PUT (strdup (dirent->d_name));	    /* Read the file and learn about the code set name.  */	    if (buf == NULL)	      {		buf = alloca (sizeof (CHARMAP_PATH)			      + strlen (dirent->d_name) + 1);		stpcpy (stpcpy (stpcpy (buf, CHARMAP_PATH), "/"),			dirent->d_name);	      }	    fp = fopen (buf, "r");	    if (fp != NULL)	      {		char *name = NULL;		while (!feof (fp))		  {		    char junk[BUFSIZ];		    if (fscanf (fp, " <code_set_name> %as", &name) == 1)		      break;		    do		      fgets (junk, sizeof junk, fp);		    while (strchr (junk, '\n') == NULL);		  }		fclose (fp);		if (name != NULL)		  PUT (name);	      }	  }      }  closedir (dir);  twalk (all_data, print_names);}