View | Details | Raw Unified | Return to bug 60533
Collapse All | Expand All

(-)src/lib/libc/stdtime/timelocal.c Wed Dec 24 00:42:53 2003 (-2 / +2 lines)
Lines 35-41 Link Here
35
35
36
static struct lc_time_T _time_locale;
36
static struct lc_time_T _time_locale;
37
static int _time_using_locale;
37
static int _time_using_locale;
38
static char *time_locale_buf;
38
static char *time_locale_buf = NULL;
39
39
40
#define LCTIME_SIZE (sizeof(struct lc_time_T) / sizeof(char *))
40
#define LCTIME_SIZE (sizeof(struct lc_time_T) / sizeof(char *))
41
41
Lines 111-117 Link Here
111
__time_load_locale(const char *name)
111
__time_load_locale(const char *name)
112
{
112
{
113
       return (__part_load_locale(name, &_time_using_locale,
113
       return (__part_load_locale(name, &_time_using_locale,
114
                       time_locale_buf, "LC_TIME",
114
                       &time_locale_buf, "LC_TIME",
115
                       LCTIME_SIZE, LCTIME_SIZE,
115
                       LCTIME_SIZE, LCTIME_SIZE,
116
                       (const char **)&_time_locale));
116
                       (const char **)&_time_locale));
117
}
117
}
(-)src/lib/libc/locale/ldpart.c Wed Dec 24 00:29:58 2003 (-5 / +15 lines)
Lines 66-74 Link Here
66
       /*
66
       /*
67
        * If the locale name is the same as our cache, use the cache.
67
        * If the locale name is the same as our cache, use the cache.
68
        */
68
        */
69
       if (*locale_buf != NULL && strcmp(name, *locale_buf) == 0) {
69
        if (locale_buf != NULL) {      
70
               *using_locale = 1;
70
               if (*locale_buf != NULL) {
71
               return (_LDP_CACHE);
71
                       if (strcmp(name, locale_buf) == 0) {
72
                               *using_locale = 1;
73
                               return (_LDP_CACHE);
74
                       }
75
                  
76
               }
77
          
72
       }
78
       }
73
79
74
       /*
80
       /*
Lines 121-128 Link Here
121
       /*
127
       /*
122
        * Record the successful parse in the cache.
128
        * Record the successful parse in the cache.
123
        */
129
        */
124
       if (*locale_buf != NULL)
130
        if (locale_buf != NULL) {
125
               free(*locale_buf);
131
               if (*locale_buf != NULL) {
132
                       free(*locale_buf);
133
                       *locale_buf = NULL;
134
               }
135
       }
126
       *locale_buf = lbuf;
136
       *locale_buf = lbuf;
127
       for (p = *locale_buf, i = 0; i < num_lines; i++)
137
       for (p = *locale_buf, i = 0; i < num_lines; i++)
128
               dst_localebuf[i] = (p += strlen(p) + 1);
138
               dst_localebuf[i] = (p += strlen(p) + 1);
(-)src/lib/libc/locale/lmessages.c Tue Dec 23 23:56:30 2003 (-3 / +3 lines)
Lines 28-34 Link Here
28
__FBSDID("$FreeBSD: src/lib/libc/locale/lmessages.c,v 1.9.2.2 2002/08/12 11:17:37 ache Exp $");
28
__FBSDID("$FreeBSD: src/lib/libc/locale/lmessages.c,v 1.9.2.2 2002/08/12 11:17:37 ache Exp $");
29
29
30
#include <stddef.h>
30
#include <stddef.h>
31
31
#include <stdlib.h>
32
#include "lmessages.h"
32
#include "lmessages.h"
33
#include "ldpart.h"
33
#include "ldpart.h"
34
34
Lines 47-53 Link Here
47
47
48
static struct lc_messages_T _messages_locale;
48
static struct lc_messages_T _messages_locale;
49
static int     _messages_using_locale;
49
static int     _messages_using_locale;
50
static char    *_messages_locale_buf;
50
static char    *_messages_locale_buf = NULL;
51
51
52
int
52
int
53
__messages_load_locale(const char *name)
53
__messages_load_locale(const char *name)
Lines 55-61 Link Here
55
       int ret;
55
       int ret;
56
56
57
       ret = __part_load_locale(name, &_messages_using_locale,
57
       ret = __part_load_locale(name, &_messages_using_locale,
58
                 _messages_locale_buf, "LC_MESSAGES",
58
                 &_messages_locale_buf, "LC_MESSAGES",
59
                 LCMESSAGES_SIZE_FULL, LCMESSAGES_SIZE_MIN,
59
                 LCMESSAGES_SIZE_FULL, LCMESSAGES_SIZE_MIN,
60
                 (const char **)&_messages_locale);
60
                 (const char **)&_messages_locale);
61
       if (ret == _LDP_LOADED) {
61
       if (ret == _LDP_LOADED) {
(-)src/lib/libc/locale/lmonetary.c Wed Dec 24 00:10:09 2003 (-2 / +2 lines)
Lines 60-66 Link Here
60
60
61
static struct lc_monetary_T _monetary_locale;
61
static struct lc_monetary_T _monetary_locale;
62
static int     _monetary_using_locale;
62
static int     _monetary_using_locale;
63
static char    *_monetary_locale_buf;
63
static char    *_monetary_locale_buf = NULL;
64
64
65
static char
65
static char
66
cnv(const char *str)
66
cnv(const char *str)
Lines 78-84 Link Here
78
       int ret;
78
       int ret;
79
79
80
       ret = __part_load_locale(name, &_monetary_using_locale,
80
       ret = __part_load_locale(name, &_monetary_using_locale,
81
               _monetary_locale_buf, "LC_MONETARY",
81
               &_monetary_locale_buf, "LC_MONETARY",
82
               LCMONETARY_SIZE, LCMONETARY_SIZE,
82
               LCMONETARY_SIZE, LCMONETARY_SIZE,
83
               (const char **)&_monetary_locale);
83
               (const char **)&_monetary_locale);
84
       if (ret != _LDP_ERROR)
84
       if (ret != _LDP_ERROR)
(-)src/lib/libc/locale/lnumeric.c Tue Dec 23 23:56:21 2003 (-2 / +3 lines)
Lines 28-33 Link Here
28
__FBSDID("$FreeBSD: src/lib/libc/locale/lnumeric.c,v 1.10.2.2 2002/08/12 11:17:38 ache Exp $");
28
__FBSDID("$FreeBSD: src/lib/libc/locale/lnumeric.c,v 1.10.2.2 2002/08/12 11:17:38 ache Exp $");
29
29
30
#include <limits.h>
30
#include <limits.h>
31
#include <stdlib.h>
31
#include "lnumeric.h"
32
#include "lnumeric.h"
32
#include "ldpart.h"
33
#include "ldpart.h"
33
34
Lines 46-52 Link Here
46
47
47
static struct lc_numeric_T _numeric_locale;
48
static struct lc_numeric_T _numeric_locale;
48
static int     _numeric_using_locale;
49
static int     _numeric_using_locale;
49
static char    *_numeric_locale_buf;
50
static char    *_numeric_locale_buf = NULL;
50
51
51
int
52
int
52
__numeric_load_locale(const char *name)
53
__numeric_load_locale(const char *name)
Lines 54-60 Link Here
54
       int ret;
55
       int ret;
55
56
56
       ret = __part_load_locale(name, &_numeric_using_locale,
57
       ret = __part_load_locale(name, &_numeric_using_locale,
57
               _numeric_locale_buf, "LC_NUMERIC",
58
               &_numeric_locale_buf, "LC_NUMERIC",
58
               LCNUMERIC_SIZE, LCNUMERIC_SIZE,
59
               LCNUMERIC_SIZE, LCNUMERIC_SIZE,
59
               (const char **)&_numeric_locale);
60
               (const char **)&_numeric_locale);
60
       if (ret != _LDP_ERROR)
61
       if (ret != _LDP_ERROR)

Return to bug 60533