svn commit: r316418 - head/bin/sh

Jilles Tjoelker jilles at FreeBSD.org
Sun Apr 2 14:02:12 UTC 2017


Author: jilles
Date: Sun Apr  2 14:02:10 2017
New Revision: 316418
URL: https://svnweb.freebsd.org/changeset/base/316418

Log:
  sh: Remove global state from collate_range_cmp().
  
  The global state is not used across invocations of collate_range_cmp().

Modified:
  head/bin/sh/expand.c

Modified: head/bin/sh/expand.c
==============================================================================
--- head/bin/sh/expand.c	Sun Apr  2 13:43:45 2017	(r316417)
+++ head/bin/sh/expand.c	Sun Apr  2 14:02:10 2017	(r316418)
@@ -145,10 +145,12 @@ appendarglist(struct arglist *list, char
 static int
 collate_range_cmp(wchar_t c1, wchar_t c2)
 {
-	static wchar_t s1[2], s2[2];
+	wchar_t s1[2], s2[2];
 
 	s1[0] = c1;
+	s1[1] = L'\0';
 	s2[0] = c2;
+	s2[1] = L'\0';
 	return (wcscoll(s1, s2));
 }
 


More information about the svn-src-all mailing list