diff --git a/contrib/unaccent/unaccent.c b/contrib/unaccent/unaccent.c
index a337df6..c485a41 100644
--- a/contrib/unaccent/unaccent.c
+++ b/contrib/unaccent/unaccent.c
@@ -105,15 +105,16 @@ initTrie(char *filename)
 			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.
+				 * 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 a replacement.
 				 */
 				int			state;
 				char	   *ptr;
 				char	   *src = NULL;
-				char	   *trg = NULL;
+				char	   *trg = "";
 				int			ptrlen;
 				int			srclen = 0;
 				int			trglen = 0;
@@ -160,6 +161,10 @@ initTrie(char *filename)
 					}
 				}
 
+				/* It's OK to have a valid src and empty trg. */
+				if (state > 0 && trglen == 0)
+					state = 5;
+
 				if (state >= 3)
 					rootTrie = placeChar(rootTrie,
 										 (unsigned char *) src, srclen,
