Commit Graph

33 Commits

Author SHA1 Message Date
Pedro F. Giffuni
1de7b4b805 various: general adoption of SPDX licensing ID tags.
Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

No functional change intended.
2017-11-27 15:37:16 +00:00
Eric van Gyzen
b54d51ac86 locale: fix the powerpc build
Reported by:	markj (and bde, in a way)
MFC after:	3 days
X-MFC with:	r309364
Sponsored by:	Dell EMC
2016-12-06 15:42:18 +00:00
Eric van Gyzen
b28fd8ce86 locale: enable more warnings; fix them
Do not set WARNS, so it gets the current default of 6.
Fix the warnings by sprinkling static, const, or strdup.
Make some constant data tables const.  Fix whitespace.

MFC after:	1 week
Sponsored by:	Dell EMC
2016-12-01 17:36:31 +00:00
Eric van Gyzen
71500aab3e locale: fix buffer management
Also, handle signed and unsigned chars, and more gracefully handle
invalid input.

Submitted by:	bde in response to r309331
MFC after:	1 week
Sponsored by:	Dell EMC
2016-12-01 16:54:02 +00:00
Eric van Gyzen
dc521a5840 Include limits.h for CHAR_MAX
This was needed on stable/10.  Apparently, sys/param.h supplies CHAR_MAX
on head.  Include limits.h anyway, for consistency, and because C says so.

Sponsored by:	Dell EMC
2016-11-30 18:34:40 +00:00
Eric van Gyzen
54068d184c locale: fix display of "grouping" and "mon_grouping" values
The "grouping" and "mon_grouping" values are arrays of one-byte
integers, not arrays of ASCII characters.  Display them in a format
similar to GNU and MacOS.

MFC after:	3 days
Sponsored by:	Dell EMC
2016-11-19 02:09:58 +00:00
Hajimu UMEMOTO
454d904a0e We need to lookup locale when command line arguments
are specified, as well.
MFC after:	1 week
2016-11-18 17:18:05 +00:00
Hajimu UMEMOTO
bfe9db5816 Lookup locale when print all keywords as well.
Reported by:	dumbbell
Reviewed by:	dumbbell
MFC after:	1 week
2016-11-18 16:48:37 +00:00
Marcelo Araujo
d7d0513c31 Use nitems() from sys/param.h.
MFC after:	2 weeks.
Sponsored by:	gandi.net (BSD Day Taiwan)
2016-07-30 07:04:46 +00:00
Baptiste Daroussin
206541f231 Use the nitems() macro 2016-04-17 22:42:48 +00:00
Eitan Adler
463a577b27 Fix a ton of speelling errors
arc lint is helpful

Reviewed By: allanjude, wblock, #manpages, chris@bsdjunk.com
Differential Revision: https://reviews.freebsd.org/D3337
2015-10-21 05:37:09 +00:00
Greg Lehey
90f854b880 Correctly handle keywords without options.
Reported by: swills@
MFC after:	14 days
2012-11-17 23:49:20 +00:00
Greg Lehey
37943b9ccc More style(9) tabs vs. spaces:
- tabs after #define
- Not in comments.

MFC after:	2 weeks
2012-11-10 06:10:07 +00:00
Greg Lehey
021680fd8f Replace spaces by tabs where appropriate.
Reminded by: jh@
2012-11-08 23:46:15 +00:00
Greg Lehey
f27de7742d Make parameters to -c and -k options optional. If no parameters are
supplied, print information for all keywords.

Improve output of -c option, in particular in conjunction with -k
option.

MFC after:	14 days
2012-11-08 02:55:30 +00:00
Edwin Groothuis
dec5a150d1 Add the comment "(FreeBSD only)" to the altmonth_x keywords
MFC after:	1 week
2009-10-07 21:14:45 +00:00
Edwin Groothuis
d5060740e3 Backout changes for c_fmt, x_fmt and X_fmt, they were coming from
the wrong patches. Apologies.
2009-10-05 07:21:21 +00:00
Edwin Groothuis
a250649bd8 Modified locale(1) to be able to show the altmon_X fields and the [cxX]_fmt's.
Also modify the "-k list" option to display only fields with a certain prefix.

MFC after:	1 week
2009-10-05 07:11:19 +00:00
Tim J. Robbins
633401b573 Remove la_LN.* from the list of bogus locales. They're incomplete, but
still potentially useful.
2004-08-02 12:50:12 +00:00
Tim J. Robbins
7cf18ceb88 Exclude bogus la_LN.* and UTF-8 locales from the output of locale -a
to discourage people from using them.
2004-08-02 12:28:28 +00:00
Andrey A. Chernov
af30114b09 Back out LANG printing changes. POSIX is unclear in this place, but
other systems do that in the old way.
2004-02-02 16:14:02 +00:00
Andrey A. Chernov
903e95e660 Fix printout case when LANG is overwritten by LC_ALL 2004-02-01 10:32:22 +00:00
Peter Grehan
5cfe0423e6 Userland signed char fixes for PPC build. Problems were using a char
return for getopt() and comparing to -1, ditto with fgetc() and EOF,
and using the kg_nice value from <sys/user.h>

Submitted by: Stefan Farfeleder <stefan@fafoe.narf.at>
Reviewed by: obrien, bde (a while back)
Tested lightly on: ppc, i386, make universe
2004-01-22 07:23:36 +00:00
Alexey Zelkin
2a805f6300 Move scmp() to more appropriate location 2003-06-26 11:05:56 +00:00
Alexey Zelkin
980548ef84 Add support of '-m' option to show charmaps (or correctly to say list of
available codesets)

Modify manpages appropriatelly
2003-06-26 11:01:03 +00:00
Alexey Zelkin
b1d6647755 implement LC_MONETARY's int_* keywords 2003-06-26 09:07:53 +00:00
Alexey Zelkin
48f12e5860 locale.c:
Use newly added __detect_path_locale() helper to lookup _PathLocale value.
It adds boundary checking for PATH_LOCALE environment variable value and
check for super-user fallback.

Makefile:

Add lib/libc/locale to compiler's include path (for setlocale.h)
2003-06-25 23:05:11 +00:00
Alexey Zelkin
d8d4841398 Catch up with _PATH_LOCALE move from rune.h to paths.h 2003-06-25 22:31:42 +00:00
Alexey Zelkin
3f101ba0a5 Add FreeBSD specific keyword 'list' implementation. 'locale -k list' can
be used to retrieve list of all available keywords now.
2003-06-22 08:34:27 +00:00
Alexey Zelkin
3c6001ec5d Fix few typos and remove two unneeded checks
Noticed by:	ache
2003-06-20 13:29:43 +00:00
Alexey Zelkin
b67daebabc Fix most warnings, sort prototypes, kill spaces at EOLs 2003-06-20 13:23:51 +00:00
Alexey Zelkin
b296024678 Complete rewrite of locale(1) in order to become POSIX complaint utilitty.
It's possibly not completely complaint with POSIX requirements, but
very close to it now.
2003-06-20 11:45:43 +00:00
Alexey Zelkin
84cb77d4aa Add locale(1). I have used it for while as useful debugging tool
for locale related things.  So, I think it could be useful for
others.  It's not yet implement (or implement in different manner)
all POSIX things, but I think it's good enough for start.

POSIX conformance related updates and manpage to follow relatively soon.
2002-10-16 13:17:18 +00:00