aboutsummaryrefslogtreecommitdiff
path: root/usr.bin
Commit message (Collapse)AuthorAgeFilesLines
* Oops, update usage() to have -i.Juli Mallett2002-05-071-2/+2
| | | | Notes: svn path=/head/; revision=96189
* Add handling for any nil-length string passed to -i for the backup extension.Juli Mallett2002-05-072-2/+21
| | | | | | | Add a note that this is kinda-sorta dangerous to the manual page. Notes: svn path=/head/; revision=96188
* Un-shadow the `fname' variable.Juli Mallett2002-05-071-9/+9
| | | | Notes: svn path=/head/; revision=96185
* Add a -i option to sed(1) to do inplace editing, to give us an alternative toJuli Mallett2002-05-072-3/+77
| | | | | | | | | | | | | | | | | | | | | Perl for such things. The key difference to Perl is that a backup extension *MUST* be specified, because on one hand it isn't recommended to have options which optionally take a parameter, and on the other hand, it'd be slightly unpleasent to implement proper handling for that. The difference between this and the version posted to developers@ is that it does handle multiple files in argv after the getopt(3) handling "correctly", in that the inplace editing-specific code has been moved out to a function, and that function is used beyond the first file in our linked list. This option has been documented as FreeBSD-specific in the manpage. Reviewed by: developers@ (got feedback from: des, fanf, sobomax, roberto, obrien) MFC after: 1 week Notes: svn path=/head/; revision=96175
* Add myself.Tony Finch2002-05-071-0/+1
| | | | | | | Reviewed by: dwmalone (mentor) Notes: svn path=/head/; revision=96157
* Make sure the file in Attic is really "dead".Ruslan Ermilov2002-05-071-91/+0
| | | | | | | Problem found by: ken Notes: svn path=/head/; revision=96147
* Affect the first of stdin, stdout and stderr that is attached to a terminal.Tim J. Robbins2002-05-062-17/+28
| | | | | | | | | | | | | Write status information to stdout instead of stderr. Exit status when an error occurs musn't be 1, that is reserved for indicating that messages are disabled. These changes bring mesg(1) up to SUSv3 conformance. Reviewed by: mike Notes: svn path=/head/; revision=96093
* -I and -J both set the same variable, replstr, to the string to replace withJuli Mallett2002-05-061-0/+2
| | | | | | | | a line of input, and both work differently, so prevent them from both being passed to xargs(1). Notes: svn path=/head/; revision=96092
* - Properly initialize the count_win when the user turns the info windowMark Peek2002-05-061-1/+4
| | | | | | | | | | | | back on (and count_win is recreated). - Create info_win as the same size for all invocations. PR: 37552 Submitted by: Mark Valentine <mark@thuvia.demon.co.uk> MFC after: 1 week Notes: svn path=/head/; revision=96088
* Fix make(1) behaviour regarding SysV-style substitution when given a nilJuli Mallett2002-05-051-0/+6
| | | | | | | | | | | left-hand-side. PR: bin/5297 Submitted by: "Matthew Emmerton" <matt@gsicomp.on.ca> MFC after: 1 week Notes: svn path=/head/; revision=96071
* Modify the -p implementation to use a user's locale, so they can respond toJuli Mallett2002-05-052-13/+63
| | | | | | | | | | | | | | | the prompt in their native language. Also make the prompt fit what POSIX asks for (?...). This should not affect use of -p with yes(1) [as every locale I know of matches 'y' as YESEXPR as well], but that's what -t is for anyway. -p is meant to be really used interactively. Submitted by: tjr, jmallett Notes: svn path=/head/; revision=96057
* Fix a typo.Juli Mallett2002-05-051-2/+3
| | | | | | | | | Submitted by: Carl Schmidt <cschmidt@slackerbsd.org> Wrap an obscenely long line while I'm here. Notes: svn path=/head/; revision=96055
* In an effort to make this utility easier to work with at a source level, moveJuli Mallett2002-05-051-141/+154
| | | | | | | | | | | | | | | | | out the parse loop to a seperate function, and move local variables around as is needed. To keep the state of some variables and keep from having huge arg lists to functions, make a bunch global. Change use of err(3) in situations where malloc(3) will be setting errno to errx(3) since assuming malloc(3) sets errno is non-portable, and provides no more useful information in the context of FreeBSD. Submitted by: bde (err/errx), Carl Schmidt <cschmidt@slackerbsd.org> (some of the movement of the input loop to a function) Approved by: src/tools/regression/usr.bin/xargs Notes: svn path=/head/; revision=96050
* Document the fact that at(1) is run through cron(8) and that this affectsJeroen Ruigrok van der Werven2002-05-041-0/+14
| | | | | | | | | the granularity of the at queue runs. Submitted by: mux Notes: svn path=/head/; revision=96032
* Add myself.Jonathan Mini2002-05-041-0/+1
| | | | | | | Approved by: alfred Notes: svn path=/head/; revision=96015
* Grouping changes.Juli Mallett2002-05-041-2/+2
| | | | | | | Submitted by: Carl Schmidt <cschmidt@slackerbsd.org> Notes: svn path=/head/; revision=96014
* Don't use pointers as booleans.Juli Mallett2002-05-041-3/+3
| | | | Notes: svn path=/head/; revision=96013
* Replace calloc(3) with malloc(3), and set the tail of theJuli Mallett2002-05-041-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | argument list to NULL, to terminate the arguments passed to execvp(2). Thanks to: bde (for pointing out some missing parens) And with apologies to Ozzy Osbourne: On his way to dinner It took him by surprise When an email from bde Said his code was full of lies Style (indentation) And his bracing were all wrong He casted to size_t When he should have cast to long I don't mind Single letter identifiers Unwrapped Line Over 80 chars Far over 80 chars Who can we get to send diffs We need Bruce D. Evans Shows you comparason to his We need Bruce D. Evans again Notes: svn path=/head/; revision=96006
* Rename `eqrelval' which was renamed from `eqrel' to quiet a shadow warningJuli Mallett2002-05-031-3/+3
| | | | | | | | | | to `op' as suggested by Bruce, as this is used to store the operator between vl and vr. Submitted by: bde Notes: svn path=/head/; revision=95998
* Fix a bug whereby we were getting ~0 and comparing it to maxsize, i.e. ifJuli Mallett2002-05-031-1/+1
| | | | | | | | | | s1 was 0 length, and replstr was 0 length, etc., we would end up subtracting one from zero and seeing if it was greater than the size_t (unsigned) var maxsize... This would cause us to return a string consisting of essentially only match, which is not the right behaviour if we have 0 length inpline. Notes: svn path=/head/; revision=95996
* Move substitution out to a function, prerun(), and replace use of run() withJuli Mallett2002-05-031-85/+78
| | | | | | | | | | it. It handles everything (right now) that needs done before run(), except the -J case, because while that would be easy, I don't quite understand -J. Reviewed by: src/tools/regression/usr.bin/xargs Notes: svn path=/head/; revision=95990
* Get rid of bogus holder for realloc(3).Juli Mallett2002-05-031-6/+5
| | | | Notes: svn path=/head/; revision=95987
* Rewrite the loop that handles substitution in the -I case, and try to makeJuli Mallett2002-05-031-15/+75
| | | | | | | | | | | | it easier to understand. Making it easy to understand isn't all that easy, so litter the code with comments so some other poor soul can come along some day and work on this if they see fit to do so. Avoid calling strlen(3) to check for a nil-string, when we can just check for *str=='\0'. Approved by: src/tools/regression/usr.bin/xargs/ Notes: svn path=/head/; revision=95986
* Rename `lflag' to `Lflag' to match the option's case.Juli Mallett2002-05-031-6/+6
| | | | Notes: svn path=/head/; revision=95985
* Revert revision 1.22. I incorrectly modified the Berkeley identifiers.Juli Mallett2002-05-031-3/+12
| | | | | | | Requested by: bde, mike Notes: svn path=/head/; revision=95983
* Revert vendor identifiers, and #if 0 what is #if 0/#else for OpenBSD.Juli Mallett2002-05-036-13/+52
| | | | | | | | | Add __FBSDID() properly. Requested by: bde, mike Notes: svn path=/head/; revision=95982
* Add the csplit(1) utility, which splits files based on context, as specifiedTim J. Robbins2002-05-021-0/+5
| | | | | | | | | | | | by SUSv3. This Makefile got left out of the previous commit. PR: 36191 Reviewed by: mike Notes: svn path=/head/; revision=95927
* Add the csplit(1) utility, which splits files based on context, as specifiedTim J. Robbins2002-05-023-0/+589
| | | | | | | | | | by SUSv3. PR: 36191 Reviewed by: mike Notes: svn path=/head/; revision=95926
* Remove redundant declarations of getopt(3) externals (since <unistd.h> doesJuli Mallett2002-05-022-4/+2
| | | | | | | | take care of them), and add __FreeBSD__ to the defined() checks for the _PATH_DIVNAME. Notes: svn path=/head/; revision=95918
* __COPYRIGHT() and __SCCSID().Juli Mallett2002-05-021-12/+3
| | | | Notes: svn path=/head/; revision=95917
* An explicit cast to size_t for an inline integer, since the two are not theJuli Mallett2002-05-021-2/+2
| | | | | | | | | | same on Alpha and lint(1) pointed that out. lint(1) on the same architecture pointed out how silly a cast to (u_int) to malloc(3)'s argument was. Change that to size_t. Notes: svn path=/head/; revision=95916
* A markup fix, and document -R as non-standard.Juli Mallett2002-05-021-3/+5
| | | | Notes: svn path=/head/; revision=95906
* Make -J a proper flag internal to the code (rather than just check forJuli Mallett2002-05-022-10/+30
| | | | | | | | | | | use of replstr and lack of Iflag), and add -R, which when given with -I controls the number of arguments on which replacement will be done. Some people happen to think it's idiotic to limit to 5 arguments, so let the user override it if they like. Notes: svn path=/head/; revision=95905
* *str is spelled 's1' inside the body of the code.Juli Mallett2002-05-021-4/+2
| | | | | | | | Make 'this' not a local variable, since it isn't necessary or complex enough to warrant such. Notes: svn path=/head/; revision=95900
* Rework some of the -I support so I can't find a way to make xargs(1) core orJuli Mallett2002-05-022-15/+14
| | | | | | | | | | | corrupt memory. Simplifies the code in one or two places, also removes some code that looks like it was bogus or incomplete. Update strnsubst to have one or two extra conditions which maybe would make it more efficient, or at least more versatile. This is likely a no-op. Notes: svn path=/head/; revision=95898
* Add some spurious veritcal whitespace to reduce diffs to OpenBSD.Juli Mallett2002-05-011-0/+2
| | | | Notes: svn path=/head/; revision=95888
* Merge local changes again, against ANSIfied m4(1).Juli Mallett2002-05-018-245/+109
| | | | Notes: svn path=/head/; revision=95887
* Do not bother with #include <machine/psl.h> since it is just a stub filePeter Wemm2002-05-011-1/+0
| | | | | | | that says something like "/* Not used on Alpha */". Notes: svn path=/head/; revision=95854
* Build elf2aout for sparc64.Jake Burkholder2002-04-301-0/+4
| | | | Notes: svn path=/head/; revision=95763
* Don't use ISO_8859 when I should use ISO8859.David Malone2002-04-297-2/+1057
| | | | Notes: svn path=/head/; revision=95753
* Do not override the `install' target.Ruslan Ermilov2002-04-291-1/+1
| | | | Notes: svn path=/head/; revision=95716
* Add a French calendar.David Malone2002-04-284-3/+19
| | | | | | | | | PR: 32265 Submitted by: Thierry Thomas <thierry@pompo.net> MFC after: 1 week Notes: svn path=/head/; revision=95688
* Minor nit; return(foo) from main rather than exit(foo).Mark Murray2002-04-281-1/+1
| | | | Notes: svn path=/head/; revision=95657
* Very minor whitespace nit.Mark Murray2002-04-281-1/+0
| | | | Notes: svn path=/head/; revision=95656
* Remove GCC-specific flags.Mark Murray2002-04-281-1/+0
| | | | Notes: svn path=/head/; revision=95655
* Reorder for style.Mark Murray2002-04-281-3/+3
| | | | Notes: svn path=/head/; revision=95654
* Remove GCC-specific flags.Mark Murray2002-04-281-1/+0
| | | | Notes: svn path=/head/; revision=95653
* Fix VCS tags; ANSIfy functionsMark Murray2002-04-281-14/+8
| | | | Notes: svn path=/head/; revision=95652
* Add some function prototypes to squash warnings.Mark Murray2002-04-281-0/+6
| | | | Notes: svn path=/head/; revision=95651
* Easy warns fixes; sort out some types and me them a bit more consistent;Mark Murray2002-04-281-8/+9
| | | | | | | fix initialisers. Notes: svn path=/head/; revision=95650