Deleted Added
full compact
ldpart.c (116274) ldpart.c (116875)
1/*
2 * Copyright (c) 2000, 2001 Alexey Zelkin <phantom@FreeBSD.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
1/*
2 * Copyright (c) 2000, 2001 Alexey Zelkin <phantom@FreeBSD.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: head/lib/libc/locale/ldpart.c 116274 2003-06-13 00:14:07Z jkh $");
28__FBSDID("$FreeBSD: head/lib/libc/locale/ldpart.c 116875 2003-06-26 10:46:16Z phantom $");
29
30#include "namespace.h"
31#include <sys/types.h>
32#include <sys/stat.h>
33
34#include <errno.h>
35#include <fcntl.h>
36#include <limits.h>
37#include <stdlib.h>
38#include <string.h>
39#include <unistd.h>
40#include "un-namespace.h"
41
29
30#include "namespace.h"
31#include <sys/types.h>
32#include <sys/stat.h>
33
34#include <errno.h>
35#include <fcntl.h>
36#include <limits.h>
37#include <stdlib.h>
38#include <string.h>
39#include <unistd.h>
40#include "un-namespace.h"
41
42#include "setlocale.h"
43#include "ldpart.h"
42#include "ldpart.h"
43#include "setlocale.h"
44
45static int split_lines(char *, const char *);
46
47int
48__part_load_locale(const char *name,
49 int *using_locale,
50 char **locale_buf,
51 const char *category_filename,

--- 23 unchanged lines hidden (view full) ---

75 }
76
77 /*
78 * Slurp the locale file into the cache.
79 */
80 namesize = strlen(name) + 1;
81
82 /* 'PathLocale' must be already set & checked. */
44
45static int split_lines(char *, const char *);
46
47int
48__part_load_locale(const char *name,
49 int *using_locale,
50 char **locale_buf,
51 const char *category_filename,

--- 23 unchanged lines hidden (view full) ---

75 }
76
77 /*
78 * Slurp the locale file into the cache.
79 */
80 namesize = strlen(name) + 1;
81
82 /* 'PathLocale' must be already set & checked. */
83
83 /* Range checking not needed, 'name' size is limited */
84 strcpy(filename, _PathLocale);
85 strcat(filename, "/");
86 strcat(filename, name);
87 strcat(filename, "/");
88 strcat(filename, category_filename);
89 if ((fd = _open(filename, O_RDONLY)) < 0)
90 return (_LDP_ERROR);

--- 71 unchanged lines hidden ---
84 /* Range checking not needed, 'name' size is limited */
85 strcpy(filename, _PathLocale);
86 strcat(filename, "/");
87 strcat(filename, name);
88 strcat(filename, "/");
89 strcat(filename, category_filename);
90 if ((fd = _open(filename, O_RDONLY)) < 0)
91 return (_LDP_ERROR);

--- 71 unchanged lines hidden ---