Loading...
locale/setinvalidrune.c Libc-1725.40.4 Libc-583
--- Libc/Libc-1725.40.4/locale/setinvalidrune.c
+++ Libc/Libc-583/locale/setinvalidrune.c
@@ -40,13 +40,12 @@
 #include "xlocale_private.h"
 
 #include <rune.h>
-#include "mblocal.h"
 #include "runedepreciated.h"
 
 void
-setinvalidrune(rune_t ir)
+setinvalidrune(ir)
+	rune_t ir;
 {
-	struct xlocale_ctype *rl;
 	static int warn_depreciated = 1;
 	locale_t loc = __current_locale();
 
@@ -55,15 +54,14 @@
 		fprintf(stderr, __rune_depreciated_msg, "setinvalidrune");
 	}
 
-	rl = (void *)loc->components[XLC_CTYPE];
-	if (rl->_CurrentRuneLocale->__invalid_rune != ir) {
-		struct xlocale_ctype *new = (struct xlocale_ctype *)malloc(rl->__datasize);
+	if (loc->__lc_ctype->_CurrentRuneLocale.__invalid_rune != ir) {
+		struct __xlocale_st_runelocale *new = (struct __xlocale_st_runelocale *)malloc(loc->__lc_ctype->__datasize);
 		if (!new)
 			return;
-		*new = *rl;
-		new->header.header.retain_count = 1;
-		new->_CurrentRuneLocale->__invalid_rune = ir;
-		xlocale_release(rl);
-		loc->components[XLC_CTYPE] = (void *)new;
+		*new = *loc->__lc_ctype;
+		new->__refcount = 1;
+		new->_CurrentRuneLocale.__invalid_rune = ir;
+		XL_RELEASE(loc->__lc_ctype);
+		loc->__lc_ctype = new;
 	}
 }