Commit Graph

3101 Commits

Author SHA1 Message Date
ast
83d9b54597 Fix PR bin/48202 [non-critical/low]:
sh +nounset and `for X; do` iteration fails if parameter set empty
by applying and testing FreeBSD's patch of Oct 24 2009 for this; see
  http://svnweb.freebsd.org/base/head/bin/sh/expand.c?r1=198453&r2=198454
Also created an ATF test in tests/bin/sh/t_expand.sh for this error and
corrected a space->tabs problem there as well.
2013-10-06 21:05:50 +00:00
christos
b258a62a64 add stdio.h 2013-10-02 21:48:55 +00:00
christos
ca8473e079 document LINENO
XXX: someone should fix all the .Ev stuff because some of them are just
shell variables .Va and are not really exported to the environment. See
the FreeBSD man page.
2013-10-02 20:42:56 +00:00
christos
018a6f7864 add crude $LINENO support for FreeBSD 2013-10-02 19:52:58 +00:00
christos
700d3ab22a - print the line discipline using the new ioctl
- print the queue size
2013-09-12 19:47:23 +00:00
christos
eca938ae97 CID 1060854: Wrong sizeof argument (SIZEOF_MISMATCH) 2013-08-06 05:42:43 +00:00
christos
e164b1463b PR/48095: NAKAJIMA Yoshihiro: remove casts from time_t to long 2013-07-29 17:46:36 +00:00
christos
248e8c4711 fix error handling. 2013-07-19 15:53:00 +00:00
wiz
29c72c8d8a Sort. 2013-07-19 11:19:23 +00:00
roy
579c771490 Add the following options
-A Display the FQDN of each address on all interfaces.
-a Display alias name(s) of the host.
-d Display the DNS domain.
-f Display the FQDN for the hostname.
-I Display each IP address on all interfaces.
-i Display the IP address(es) for the hostname.
2013-07-19 10:34:51 +00:00
christos
37a296c0b9 PR/48057: psi: skip and msgfmt cannot be used together. Looks like a pasto;
fixed.
2013-07-17 12:55:48 +00:00
christos
37e3924882 WARNS=6 [-Wconversion] 2013-07-16 17:47:43 +00:00
joerg
9e69720425 Fix violations of the sequence point rule. 2013-06-28 15:04:35 +00:00
yamt
44f7683783 fix descriptor leaks. PR/47805
this fix was taken from FreeBSD SVN rev 199953 (Jilles Tjoelker)
    ------------------------------------------------------------------------
    r199953 | jilles | 2009-11-30 07:33:59 +0900 (Mon, 30 Nov 2009) | 16 lines

    Fix some cases where file descriptors from redirections leak to programs.

    - Redirecting fds that were not open before kept two copies of the
      redirected file.
	sh -c '{ :; } 7>/dev/null; fstat -p $$; true'
	(both fd 7 and 10 remained open)
    - File descriptors used to restore things after redirection were not
      set close-on-exec, instead they were explicitly closed before executing
      a program normally and before executing a shell procedure. The latter
      must remain but the former is replaced by close-on-exec.
	sh -c 'exec 7</; { exec fstat -p $$; } 7>/dev/null; true'
	(fd 10 remained open)

    The examples above are simpler than the testsuite because I do not want to
    use fstat or procstat in the testsuite.
2013-06-27 23:22:04 +00:00
yamt
071e965c48 constify 2013-06-12 01:36:52 +00:00
simonb
3a5cb7b1be Document that a here-document can finish at an EOF as well as at the
delimiter.
2013-05-09 11:43:27 +00:00
uebayasi
02829a8ca7 test(1): Compare timestamp in nsec scale in -nt/-ot. 2013-05-04 06:26:44 +00:00
zafer
51b7448f79 remove whitespace from end of file.
introduced by erh in 1.49
2013-05-02 22:43:55 +00:00
dholland
7e346d08a4 Add const. 2013-04-28 17:01:28 +00:00
wiz
eb5604b032 Sort sections. 2013-04-26 19:34:34 +00:00
christos
aab67d5210 PR/47770: Eitan Adler: add x flag to rm to avoid cross mount points 2013-04-26 18:43:22 +00:00
christos
2227ba4bf1 Make shifting variables reflect their environment counterparts. Makes
"shift path" work as expected.
2013-04-03 17:32:24 +00:00
christos
2135348107 PR/47608: Robert Elz: ``var=value func-call'' does not export var in the
function (+FIX)
2013-03-02 22:02:32 +00:00
he
85e98624ed When using -ledit, also use -lterminfo, to allow static linking. 2013-01-25 19:07:14 +00:00
christos
0961e62ab9 Obey SMALLPROG and don't enable the editor 2013-01-25 14:20:57 +00:00
christos
54f7a5dbf7 Recognize extended attribute headers and warn about them since we are not
currently handling them.
2013-01-24 17:43:44 +00:00
christos
185136779b make history kind of work :-), turn libedit support on. 2013-01-23 16:39:03 +00:00
christos
9263138f08 fix compilation without -DEDIT 2013-01-22 22:40:31 +00:00
wiz
cefd6eea55 Bump date for previous. 2013-01-22 21:20:26 +00:00
christos
5e9a2dddf3 Add a little libedit front end. Could be used as someone's pet project to
learn how to program. It is not enabled in the Makefile, and it states why
there.
2013-01-22 20:35:29 +00:00
christos
cd0ed5aa5a Remove alloc builtin, it did not work anyway since most modern malloc
implementation use a combination of sbrk/mmap.
2013-01-22 19:28:00 +00:00
dsl
0e82f4eb77 include limits.h for CHAR_MIN 2013-01-02 22:28:42 +00:00
dsl
658a58d038 Add support for '%n' being a shorthand for 'fg %n'. 2012-12-31 14:10:15 +00:00
christos
55853dd5e1 sprinkle const, no functional change intended. 2012-12-27 21:19:20 +00:00
dsl
7d60739ae7 Fix the expansion of "$(foo-$bar}" so that IFS isn't applied when
expanding $bar.
Noted by Greg Troxel on tech-userlevel running some 'git' tests.
Should fix PR bin/47361
2012-12-22 20:15:22 +00:00
wiz
dbb168824f - Remove unneeded consecutive argument in `.Nm' macros;
- rename `GRAMMAR AMBIGUITY' section to `CAVEATS', and move it to
  correct location;
- bump date.

From Bug Hunting.
2012-12-16 17:57:49 +00:00
christos
6814c65d63 PR/47317: Henning Petersen: Replace index() with strchr() 2012-12-13 19:33:23 +00:00
apb
ee9a2498cf Adjust everything under src (but outside src/tools) to use
the TOOLDIR version of libnbcompat, associated include files,
and associated defs.mk file, instead of the version from the
.OBJDIR of src/tools/compat.  This should fix PR 47188.
2012-12-02 12:55:27 +00:00
abs
6f08f9dbdd PR/47167
ls.1:
- Sort options in `SYNOPSIS', the option list, and texts within
  the man page;
- improve wording;
- improve macro usage;
- use more consistency regarding (locations for) information about
  which options override which;
- cross-reference `-d' and `-R';
- simplify description of `-k', removing redundant and unneeded
  information;
- sort entry type list (but leave `-a' and `-A' as they are, given
  their meaning);
- correct / augment description of `BLOCKSIZE' environment variable
  in `ENVIRONMENT' section;
- bump date.

ls.c:
- Sort options in `usage';
- augment comment about when to figure out block size.
2012-11-20 12:37:29 +00:00
christos
9638719987 only allocate if it would not fit in our buffer. 2012-11-19 19:41:31 +00:00
christos
c25982c7d1 fix bogus warning for zero-sized files. 2012-11-19 19:34:03 +00:00
wiz
baebe9d053 Sync usage with man page. 2012-11-10 18:42:22 +00:00
wiz
c6d7976845 Sort options (no-argument ones first, then argument-taking ones). 2012-11-10 18:41:10 +00:00
christos
0002c266f0 Add an option to read with a different buffer size, and document the
buffer size we use. This allows us to cat -B 10000000 /proc/<pid>/maps
for example which cannot handle seeking.
2012-11-10 16:18:41 +00:00
christos
c8bb8a7a53 fix argument parsing. 2012-10-22 18:00:46 +00:00
christos
bc8069542c add --reference=rfile 2012-10-22 17:47:06 +00:00
wiz
9ed3eb6e68 Use more markup. 2012-10-21 08:18:27 +00:00
jschauma
708ea1dcd8 clarify that BLOCKSIZE also influences the total in long output 2012-10-21 01:39:05 +00:00
njoly
bee4003ac7 Remove a few unneeded Pp macros. 2012-10-13 14:18:16 +00:00
wiz
f8c0e3497a - Correct macro usage;
- improve wording, including creating more consistency therein.

From Bug Hunting.
2012-10-03 19:37:36 +00:00