diff --git a/contrib/unaccent/unaccent.c b/contrib/unaccent/unaccent.c
index a337df6..5a31f85 100644
*** a/contrib/unaccent/unaccent.c
--- b/contrib/unaccent/unaccent.c
*************** initTrie(char *filename)
*** 104,114 ****
  
  			while ((line = tsearch_readline(&trst)) != NULL)
  			{
! 				/*
! 				 * The format of each line must be "src trg" where src and trg
! 				 * are sequences of one or more non-whitespace characters,
! 				 * separated by whitespace.  Whitespace at start or end of
! 				 * line is ignored.
  				 */
  				int			state;
  				char	   *ptr;
--- 104,124 ----
  
  			while ((line = tsearch_readline(&trst)) != NULL)
  			{
! 				/*----------
! 				 * The format of each line must be "src" or "src trg", where
! 				 * src and trg are sequences of one or more non-whitespace
! 				 * characters, separated by whitespace.  Whitespace at start
! 				 * or end of line is ignored.  If trg is omitted, an empty
! 				 * string is used as the replacement.
! 				 *
! 				 * We use a simple state machine, with states
! 				 *	0	initial (before src)
! 				 *	1	in src
! 				 *	2	in whitespace after src
! 				 *	3	in trg
! 				 *	4	in whitespace after trg
! 				 *	-1	syntax error detected (line will be ignored)
! 				 *----------
  				 */
  				int			state;
  				char	   *ptr;
*************** initTrie(char *filename)
*** 160,166 ****
  					}
  				}
  
! 				if (state >= 3)
  					rootTrie = placeChar(rootTrie,
  										 (unsigned char *) src, srclen,
  										 trg, trglen);
--- 170,183 ----
  					}
  				}
  
! 				if (state == 1 || state == 2)
! 				{
! 					/* trg was omitted, so use "" */
! 					trg = "";
! 					trglen = 0;
! 				}
! 
! 				if (state > 0)
  					rootTrie = placeChar(rootTrie,
  										 (unsigned char *) src, srclen,
  										 trg, trglen);
