Fix a long-standing cpp compatibility bug: The -DFOO argument
(without an explicit value) should define FOO to 1 not to the empty
string.
Add support for CRLF newlines, based on a suggestion from Mark Rushakoff.
Obtained from: http://dotat.at/prog/unifdef/
sockaddr structures. As such, we have top copy the data structure
into a local buffer before we can reference it, otherwise we have
unaligned references (these are fixed up automatically on some CPUs,
but not on others). We do this unconditionally to make the code
easier to read and understand.
Submitted by: Grzegorz Bernacki
about to be extracted already exists. The question, and interpretation
of the response is deliberately compatible with Info-Zip.
This change was originally obtained from NetBSD, but has three changes:
- better compatibility with Info-Zip in the handling of ^D
- Use getdelim() rather than getline()
- bug fix: != changed to == in the "file rename" code
I suspect the latter is also a bug in NetBSD, but I can't easily confirm
this.
PR: bin/143307
Reviewed by: rdivacky (change to unzip.c only)
Obtained from: NetBSD src/usr.bin/unzip/unzip.c 1.8
MFC after: 1 month
This structure is deprecated and only used by ftime(2), which is part of
libcompat. The second argument of get_date() is unused, which means we
can just remove it entirely.
ports tree extensively and it is probably a good idea to keep it
regardless of NO_MAIL setting.
Reported by: Alexander Best
Reviewed by: antoine
X-MFC-With: r203584
isolate common code used by tar and cpio (and useful to other
libarchive clients). The functions here are prefixed with
"lafe" (libarchive front-end) to indicate their use.
is sufficiently different that it was simpler to just put separate
reporting functions into read.c and write.c rather than try to have
a single all-purpose reporting function.
Switch to a custom function for converting int64_t to a string; in
the portable version, this saves a lot of configuration headaches
trying to decipher the platform printf().
use -b 2048 (1MiB block size). Setting the limit to 8192 should
allow some room for growth while still helping people who mistakenly
put in byte counts here instead of block counts.
The bc(1) program may need to deal with files when it's being run in
interactive mode, so we can not blindly use interactive mode (in turn
use libedit) but need to check if the input source is really the standard
input.
This commit should fix a regression where 'bc -l' would not parse the
mathlib.
Reported by: trasz
- Include a cpasswd script performing the same mechanisms as the cvpasswd
utility from CVSup.
PR: bin/114129
Submitted by: Petar Zhivkov Petrov <pesho.petrov -at- gmail.com>
MFC after: 1 month
Also, change the existing -vi behavior to send the filenames to
stderr rather than stdout, as GNU cpio does.
PR: bin/141175
Submitted by: Philip Kizer
MFC after: 14 days
revision 1.91
Fri Nov 7 01:01:46 2003 UTC by lukem
Add some subsections in the VARIABLE ASSIGNMENTS section.
In the "modifier description" list, show each modifier with the leading `:'.
Rationale: it's hard to search for modifiers without it, and we already do
the same thing in the -options and .makecommands lists. I now find it much
easier to find the description for a modifier in the man page.
Obtained from: NetBSD
kept for compatibility with 4.4BSD behavior.
- Sync SYNOPSIS with usage().
- Use an alternative way to represent short and long options which have
same semantics.
Reviewed by: gabor
compatibility level with the GNU counterparts and have shown to be mature
enough. For now, the GNU versions aren't removed from the tree, just detached
from the build.
Sponsored by: Google Summer of Code 2008
Portbuild run by: erwin
Approved by: delphij
I must have misread when I ported the original last(1) source code.
Instead of only processing the last 1024 entries, it reads them in in
chucks of 1024 entries at a time.
Unfortunately we cannot walk through the log file in reverse order,
which means we have to allocate a piece of memory to hold all the
entries. Call realloc() for each 128 entries we read.
Reported by: Andrzej Tobola <ato iem pw edu pl>
file can safely be the same as the input file. Idea from IRIX unifdef(1).
This version fixes a bug in the NetBSD unifdef which refuses to
write to a -o outfile which does not exist.
Obtained from: NetBSD
This utility allows users to convert their wtmp databases to the new
format. It makes no sense for users to keep their wtmp log files if they
are unable to view them.
It basically copies ut_line into ut_id as well. This makes it possible
for last(1) and ac(8) to match login records with their corresponding
logout record.
do for IPv4 addresses without having to explicetly specify that the
ARIN server should be used to get the initial information
PR: bin/128725
Submitted by: "Matt D. Harris" <mdh_lists@yahoo.com>
MFC after: 1 week
Let it print "-" when the TTY string is empty. In this case, it must
also make sure it doesn't match processes who also have no controlling
TTY. Otherwise it will print random kernel processes when trying to pick
the best matching process.
Eventually it should look at the value of ut_pid as well.
Because getutxent also matches the typical get*ent format of library
routines, I thought it would be a good idea to teach it how to read
utmpx databases. getent(1) just gives a raw dump, which is very useful
when debugging problems related to parsing/logging.
Basically there are three major things I changed about last(1):
- It should use ut_type instead of determining by hand what type of
record was given.
- It should now keep track of ut_id's instead of TTYs. This means the
ttylist has been renamed to the idlist, storing all the ut_id's it has
processed until the next reboot.
- I've removed the signal handler. Because our wtmp is rotated so often,
it makes little sense. Even on a simple piece of hardware it should be
capable of grinding through megabytes of logs in a second.
It was already ported to use libulog, which makes it simpler now. Be
sure to catch the error returned by setutxdb(). Otherwise it may perform
a lookup on the utx.active database.
- Make one-true-awk respect locale's collating order in [a-z]
bracket expressions, until a more complete fix (like handing
BREs) is ready.
- Don't require a space between -[fv] and its argument.
2) Deregister.
3) New style function definitions.
Some WARNS still remain here - some printf format warning on some
arches and the compiler can't see that a variable should always be
initialised.
are not used uninitialised.
2) Fix some constness problems.
3) Avoid a signedness problem by casting to size_t. If bn != stuff,
than stuff-1-bn should be > 0.
Do by specifying ".../" with '-m' or MAKESYSPATH (new) environment variable.
Reviewed by: <sjg@NetBSD.org>
Obtained from: NetBSD (+ embellishment by me, sent back to NetBSD)
Std 1003.1-2008. Both Linux and Solaris conforms to the new definitions,
so we better follow too (older glibc used old BSDish alphasort prototype
and corresponding type of the comparision function for scandir). While
there, change the definitions of the functions to ANSI C and fix several
style issues nearby.
Remove requirement for "sys/types.h" include for functions from manpage.
POSIX also requires that alphasort(3) sorts as if strcoll(3) was used,
but leave the strcmp(3) call in the function for now.
Adapt in-tree callers of scandir(3) to new declaration. The fact that
select_sections() from catman(1) could modify supplied struct dirent is
a bug.
PR: standards/142255
MFC after: 2 weeks