aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/sam
AgeCommit message (Collapse)AuthorFilesLines
2021-01-14sam: avoid out-of-bounds read in rtermRuss Cox1-2/+2
Usually r->nused < r->nalloc and the read is in bounds. But it could in theory be right on the line and reading past the end of the allocation. Make it safe but preserve as much of the old semantics as possible. This use of rterm appears to be only for optimization purposes so the result does not matter for correctness.
2021-01-14sam: remove backward ?:Russ Cox1-1/+1
The exit code here is ignored anyway.
2021-01-05acme, sam, samterm: remove weird switch usageRuss Cox2-3/+5
For whatever reason all three of these programs contain switches like: switch(x) { case 1: if(cond) case 2: f(); } Like Duff's device, this is legal C but more obscure than it really needs to be. This commit assumes those are intended as written and simply writes them more clearly. I did consider that maybe they are mistakes, but in the case of sam/regexp.c, my rewrite in this commit matches the acme/regx.c that has been in plan9port since I added acme in 2003. (I didn't bother to dig up the old Plan 9 releases.) Assuming acme/regx.c has been correct for the past two decades, this commit should be correct too.
2021-01-05sam: rm dregsRuss Cox4-293/+0
2021-01-05stats: add threadmaybackgroundRuss Cox3-39/+39
2020-08-15all: a few more #define tricks for AIXRuss Cox1-0/+3
This should make the AIX build finally work. Fixes #400.
2020-01-10Trivial changes: whitespace and modes.Dan Cross8-27/+22
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>
2019-12-19sam: report close errorRuss Cox3-1/+9
2018-03-27sam: freetmpstr instead of freeXiao-Yong Jin1-1/+1
2014-03-13acme, sam: handle >1GB files correctlyRuss Cox2-2/+5
TBR=rsc https://codereview.appspot.com/74060043
2012-10-21fix clang warnings reported by Tuncer AyazRuss Cox1-1/+1
R=rsc http://codereview.appspot.com/6744054
2012-09-17sam: add $% as an alias for $samfileRuss Cox1-0/+1
R=r http://codereview.appspot.com/6488137
2010-08-04sam: use ulong as type of dev consistentlyRuss Cox1-1/+1
Otherwise io.c:39 compares int != ulong, causing spurious file modification warnings when dev doesn't fit in an int. R=r http://codereview.appspot.com/1917045
2010-07-14acme, sam: fix regexp code for bigger RunemaxRuss Cox1-24/+26
R=r http://codereview.appspot.com/1765042
2009-12-06sam: fix off-by-one in buffer merge.Russ Cox1-2/+2
exposed by UTFmax==4 R=rsc http://codereview.appspot.com/165071
2009-09-11convert to 4-byte UTF-8 and 32-bit RuneRuss Cox2-3/+3
http://codereview.appspot.com/116075
2008-04-16sam: clean up checkerrs (Rob Pike)Russ Cox1-3/+3
2008-04-15sam: allow more output from ! command (Rob Pike)Russ Cox1-2/+2
2008-01-30sam: fix regexp match choice bugRuss Cox1-1/+1
2007-12-07sam: revert regexp fixRuss Cox1-59/+49
2007-12-07sam: regexp fix (see libregexp change)Russ Cox1-49/+59
2007-12-04sam: turn off DEBUG logging (oops)Russ Cox1-1/+0
2007-06-09better fixrsc1-14/+15
2007-06-09day one bug in sam regexp codersc1-1/+1
2007-01-12change namersc2-3/+3
2007-01-12Bug fix fix - remove debugging implementation of needoutflush.rsc1-1/+2
2007-01-12Fix 15-year-old sam protocol bug.rsc4-34/+34
2006-08-29Aviod seg fault when no filersc1-1/+4
2006-08-24set $samfile during external commandsrsc1-0/+9
2006-06-26fix dup file name bugrsc1-1/+10
2006-05-06shut up gcc volatilersc1-3/+6
2006-04-21darwinrsc1-0/+3
2006-04-2064-bit fixesrsc7-81/+153
2006-04-01Use gcc -ansi -pedantic in 9c. Fix many non-C89-isms.rsc11-20/+22
2006-03-20update usagersc3-8/+1
2006-03-20update lucidarsc3-2/+9
2005-07-13warningsrsc1-0/+1
2005-05-07use full prototypesrsc1-1/+1
2005-03-18bug fix from plan 9rsc1-2/+5
2005-01-27remove debugging printrsc1-1/+0
2005-01-27add autoindent (-a) and chording.rsc4-61/+42
clean up argument parsing.
2005-01-13Many small edits.rsc1-1/+1
2005-01-04Goodbye SHORTLIBrsc1-1/+0
2004-12-28FreeBSD tweaksrsc2-3/+4
2004-12-28more little compile fixesrsc2-8/+15
2004-06-09use libplumb insteadrsc2-10/+2
2004-05-14allowrsc3-6/+25
sam -r machine filelist... from presotto
2004-04-29add -W to specify window size.rsc1-1/+7
various other little fixes.
2004-04-19clean up when finished.rsc1-1/+0
don't set PLAN9 don't set PLAN9
2004-03-26SunOS can rot in hell.rsc1-0/+1