rcolebaugh / rpms / bash

Forked from rpms/bash 2 years ago
Clone

Blame SOURCES/bash-5.1-mbrtowc.patch

85bb35
diff --git a/subst.c b/subst.c
85bb35
--- a/subst.c
85bb35
+++ b/subst.c
85bb35
@@ -6240,7 +6240,7 @@ read_comsub (fd, quoted, flags, rflag)
85bb35
 	  /* read a multibyte character from buf */
85bb35
 	  /* punt on the hard case for now */
85bb35
 	  memset (&ps, '\0', sizeof (mbstate_t));
85bb35
-	  mblen = mbrtowc (&wc, bufp-1, bufn+1, &ps);
85bb35
+	  mblen = mbrtowc (&wc, bufp-1, bufn, &ps);
85bb35
 	  if (MB_INVALIDCH (mblen) || mblen == 0 || mblen == 1)
85bb35
 	    istring[istring_index++] = c;
85bb35
 	  else