summaryrefslogtreecommitdiffstats
path: root/src/cmd/rc
Commit message (Collapse)AuthorAgeFilesLines
* Trivial changes: whitespace and modes.Dan Cross2020-01-105-10/+10
| | | | | | | | | Remote whitespace at the ends of lines. Remove blank lines from the ends of files. Change modes on source files so that they are not executable. Signed-off-by: Dan Cross <cross@gajendra.net>
* cmd/rc: fix declarations of some externally linked variablesNeven Sajko2020-01-022-3/+2
| | | | Change-Id: If8fe1afecb9fe55f85e8e5af37521b83e787d718
* rc: use proper type for storing ulimit valuesRay Lai2018-01-171-6/+7
| | | | | | | rc on amd64 stores ulimit values as 32-bit int, but the limits on OpenBSD amd64 can exceed 2^31, so "ulimit -a" shows some values as negative. This is a problem when I want to increase my ulimit but the hard ulimit values are printed as negative.
* all: remove .cvsignore filesKare Nuorteva2017-09-141-3/+0
| | | | | | | | | | Rename following .cvsignore files to .gitkeep since they are required by the build (directories must exist before build): - bin/fossil/.gitkeep - bin/fs/.gitkeep - bin/venti/.gitkeep Change-Id: I9c2865058480cffb3a4613f25e2eca1f7e5578c0
* rc: avoid undefined CXi Wang2013-03-191-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are two bugs in pdec() on INT_MIN: * wrong output. `n = 1-n' should be `n = -1-n' when n is INT_MIN. * infinite loop. gcc optimizes `if(n>=0)' into `if(true)' because `-INT_MIN' (signed integer overflow) is undefined behavior in C, and gcc assumes the negation of a negative number must be positive. The resulting binary keeps printing '-' forever given INT_MIN. Try the simplified pdec.c below. $ gcc pdec.c $ ./a.out -2147483648 --214748364* $ gcc pdec.c -O2 $ ./a.out -2147483648 <infinite loop> $ gcc pdec.c -O2 -D__PATCH__ $ ./a.out -2147483648 -2147483648 === pdec.c === #include <stdio.h> #include <stdlib.h> #include <limits.h> #define io void void pchr(io *f, int c) { putchar(c); } void pdec(io *f, int n) { if(n<0){ #ifndef __PATCH__ n=-n; if(n>=0){ pchr(f, '-'); pdec(f, n); return; } /* n is two's complement minimum integer */ n = 1-n; #else if(n!=INT_MIN){ pchr(f, '-'); pdec(f, -n); return; } /* n is two's complement minimum integer */ n = -(INT_MIN+1); #endif pchr(f, '-'); pdec(f, n/10); pchr(f, n%10+'1'); return; } if(n>9) pdec(f, n/10); pchr(f, n%10+'0'); } int main(int argc, char **argv) { int n = atoi(argv[1]); pdec(NULL, n); putchar('\n'); } R=rsc CC=plan9port.codebot https://codereview.appspot.com/7241055
* rc: silence lion roarRuss Cox2011-08-021-0/+1
| | | | | R=rsc http://codereview.appspot.com/4835048
* rc: fix $ifs bug introduced with utf-8 codeRuss Cox2011-02-161-2/+4
| | | | | R=rsc http://codereview.appspot.com/4187050
* rc: handle 4-byte utf-8Russ Cox2011-01-023-0/+20
| | | | | R=rsc http://codereview.appspot.com/3833043
* rc: handle utf-8 in $ifsRuss Cox2011-01-021-8/+16
| | | | | R=rsc http://codereview.appspot.com/3798046
* rc: implement and document <>{cmd} notationMichael Teichgräber2009-09-131-17/+47
| | | | http://codereview.appspot.com/105061
* rc: make read not ignore interrupts/errors (again)Michael Teichgräber2009-08-231-2/+7
| | | | http://codereview.appspot.com/110042
* rc: fix segfault when SIGINT is receivedMichael Teichgräber2009-08-081-1/+2
| | | | | | | | | | | | Save the value of `runq' at the start of the function, so that the `pc' update at the end does work on that original value, and not on a probably modified value of `runq'. fixes #14 http://code.swtch.com/plan9port/issue/14/ http://codereview.appspot.com/104066
* rc: fix local variables in functionsRuss Cox2008-08-142-4/+4
| | | | | | | reported by micah stetson: fn foo { echo $bar } bar=baz foo
* rc: add subscript sequences (Erik Quanstrom)Russ Cox2008-07-201-5/+35
|
* keep path and PATH in syncrsc2007-03-281-0/+2
|
* do not redefine rewindrsc2007-03-261-1/+1
|
* more memory errors (valgrind)rsc2007-03-263-1/+3
|
* fix waitrsc2007-03-265-251/+97
|
* fix phantom rc crashesrsc2007-03-261-0/+1
|
* sync with plan 9rsc2007-03-2623-1232/+1967
|
* cope with programs that leave fd in non-blocking mode (Tim Wiess)rsc2007-03-252-1/+27
|
* experiment - allow = in words late in the command linersc2006-06-271-0/+3
|
* add exitcodersc2006-04-081-0/+11
|
* Use gcc -ansi -pedantic in 9c. Fix many non-C89-isms.rsc2006-04-012-3/+3
|
* update lucidarsc2006-03-201-1/+1
|
* shut up about signals in scriptsrsc2006-02-141-1/+1
|
* Add rfork builtin.rsc2005-08-111-0/+53
|
* make sure errors cause non-zero exit statusrsc2005-08-111-0/+2
|
* fixes from bengt for sunrsc2005-07-261-2/+2
|
* ignore window size changersc2005-07-141-0/+1
|
* stupid sunrsc2005-07-131-0/+3
|
* set $PLAN9 if necessaryrsc2005-05-191-0/+3
|
* try harder to put background jobs in background; do not print in response to ↵rsc2005-03-184-1/+45
| | | | SIGPIPE
* correct command-printing bugrsc2005-03-181-1/+3
|
* handle /dev/stdin alwaysrsc2005-02-132-3/+3
|
* set pid=-1 explicitlyrsc2005-02-111-0/+1
|
* more searchpath-related changesrsc2005-01-232-1/+2
|
* use correct yaccrsc2005-01-191-1/+0
|
* Many small edits.rsc2005-01-131-0/+1
|
* maintain $path and $PATH simultaneouslyrsc2005-01-125-4/+74
|
* success on the sunrsc2005-01-071-0/+16
|
* FreeBSD tweaksrsc2004-12-281-4/+2
|
* print out signalled exitsrsc2004-10-171-0/+5
|
* add ulimit and umask as builtinsrsc2004-10-173-0/+202
|
* Supress line noise.wkj2004-05-161-0/+3
|
* More little bug fixesrsc2004-05-141-1/+0
|
* Fix small bugs.rsc2004-05-111-1/+1
|
* Little fixes.rsc2004-04-301-0/+1
|
* fixrsc2004-04-241-1/+0
|
* Add scat. Temporary fix to rc r.e. note groups.rsc2004-04-241-1/+1
|