diff --git a/ChangeLog b/ChangeLog
index e52576c6424bf59f1df411d8ad62c0d1f13816ad..d41657eeaa2e58e2b46d1f72f35b85cc6a5ee045 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -57,16 +57,16 @@ CVS code -
 	  thanks_for_all_the_fish(), nregcomp(), parse_syntax(), and
 	  parse_colors(). (Brand Huntsman and DLR)
 	- Various other color fixes.  Handle unspecified foreground
-	  colors properly, don't automatically reinitialize the
-	  displayed colors every time we update the current buffer's
-	  colors (since the buffer may not be displayed immediately),
-	  don't bother doing complete refreshes of the screen when
-	  color support is enabled if there's no regex associated with
-	  the current file, and rename variable exttype->val to
-	  exttype->ext, for consistency.  Changes to do_colorinit()
-	  (renamed color_init()), update_color() (renamed
-	  color_update()), write_file(), do_input(), do_output(), and
-	  parse_syntax(). (DLR)
+	  colors properly, flag duplicate syntax names as errors, don't
+	  automatically reinitialize the displayed colors every time we
+	  update the current buffer's colors (since the buffer may not
+	  be displayed immediately), don't bother doing complete
+	  refreshes of the screen when color support is enabled if
+	  there's no regex associated with the current file, and rename
+	  variable exttype->val to exttype->ext, for consistency.
+	  Changes to do_colorinit() (renamed color_init()),
+	  update_color() (renamed color_update()), write_file(),
+	  do_input(), do_output(), and parse_syntax(). (DLR)
 	- Simplify get_totals() to only get the total number of
 	  characters, and eliminate dependence on its old ability to get
 	  the total number of lines by renumber()ing when necessary and
diff --git a/src/rcfile.c b/src/rcfile.c
index 95277913a9066bb4591d2096d1d52b3065af1dc5..14f7016276117e2becbf3b105bd3967d59be4969 100644
--- a/src/rcfile.c
+++ b/src/rcfile.c
@@ -268,6 +268,7 @@ bool nregcomp(const char *regex, int eflags)
 void parse_syntax(char *ptr)
 {
     const char *fileregptr = NULL, *nameptr = NULL;
+    const syntaxtype *tmpsyntax;
     exttype *endext = NULL;
 	/* The end of the extensions list for this syntax. */
 
@@ -292,6 +293,14 @@ void parse_syntax(char *ptr)
     if (ptr == NULL)
 	return;
 
+    for (tmpsyntax = syntaxes; tmpsyntax != NULL;
+	tmpsyntax = tmpsyntax->next) {
+	if (mbstrcasecmp(nameptr, tmpsyntax->desc) == 0) {
+	    rcfile_error(N_("Duplicate syntax name %s"), nameptr);
+	    return;
+	}
+    }
+
     if (syntaxes == NULL) {
 	syntaxes = (syntaxtype *)nmalloc(sizeof(syntaxtype));
 	endsyntax = syntaxes;