aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/sam
Commit message (Collapse)AuthorAgeFilesLines
* all: remove need for `-fcommon`Dan Cross2025-07-251-1/+1
| | | | | | | | | | Use `extern` where appropriate so that we can remove `-fcommon` on macOS and others. On macOS, `-fcommon` generates a number of linker warnings. I've tested building on macOS, Linux, FreeBSD, NetBSD, OpenBSD and illumos. I am not in a position to test on AIX or other more esoteric platforms, however.
* sam: use get9root instead of duplicating the logicSören Tempel2022-07-271-3/+1
|
* sam: fix spurious overwrite messageRuss Cox2021-09-301-1/+1
| | | | | | | | | | | Fixes: % sam -d -. w foo foo: (new file) #0 w foo ?warning: write might change good version of `foo'
* sam: avoid out-of-bounds read in rtermRuss Cox2021-01-141-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.
* sam: remove backward ?:Russ Cox2021-01-141-1/+1
| | | | The exit code here is ignored anyway.
* acme, sam, samterm: remove weird switch usageRuss Cox2021-01-052-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.
* sam: rm dregsRuss Cox2021-01-054-293/+0
|
* stats: add threadmaybackgroundRuss Cox2021-01-053-39/+39
|
* all: a few more #define tricks for AIXRuss Cox2020-08-151-0/+3
| | | | | | This should make the AIX build finally work. Fixes #400.
* Trivial changes: whitespace and modes.Dan Cross2020-01-108-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>
* sam: report close errorRuss Cox2019-12-193-1/+9
|
* sam: freetmpstr instead of freeXiao-Yong Jin2018-03-271-1/+1
|
* acme, sam: handle >1GB files correctlyRuss Cox2014-03-132-2/+5
| | | | | TBR=rsc https://codereview.appspot.com/74060043
* fix clang warnings reported by Tuncer AyazRuss Cox2012-10-211-1/+1
| | | | | R=rsc http://codereview.appspot.com/6744054
* sam: add $% as an alias for $samfileRuss Cox2012-09-171-0/+1
| | | | | R=r http://codereview.appspot.com/6488137
* sam: use ulong as type of dev consistentlyRuss Cox2010-08-041-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
* acme, sam: fix regexp code for bigger RunemaxRuss Cox2010-07-141-24/+26
| | | | | R=r http://codereview.appspot.com/1765042
* sam: fix off-by-one in buffer merge.Russ Cox2009-12-061-2/+2
| | | | | | | exposed by UTFmax==4 R=rsc http://codereview.appspot.com/165071
* convert to 4-byte UTF-8 and 32-bit RuneRuss Cox2009-09-112-3/+3
| | | | http://codereview.appspot.com/116075
* sam: clean up checkerrs (Rob Pike)Russ Cox2008-04-161-3/+3
|
* sam: allow more output from ! command (Rob Pike)Russ Cox2008-04-151-2/+2
|
* sam: fix regexp match choice bugRuss Cox2008-01-301-1/+1
|
* sam: revert regexp fixRuss Cox2007-12-071-59/+49
|
* sam: regexp fix (see libregexp change)Russ Cox2007-12-071-49/+59
|
* sam: turn off DEBUG logging (oops)Russ Cox2007-12-041-1/+0
|
* better fixrsc2007-06-091-14/+15
|
* day one bug in sam regexp codersc2007-06-091-1/+1
|
* change namersc2007-01-122-3/+3
|
* Bug fix fix - remove debugging implementation of needoutflush.rsc2007-01-121-1/+2
|
* Fix 15-year-old sam protocol bug.rsc2007-01-124-34/+34
|
* Aviod seg fault when no filersc2006-08-291-1/+4
|
* set $samfile during external commandsrsc2006-08-241-0/+9
|
* fix dup file name bugrsc2006-06-261-1/+10
|
* shut up gcc volatilersc2006-05-061-3/+6
|
* darwinrsc2006-04-211-0/+3
|
* 64-bit fixesrsc2006-04-207-81/+153
|
* Use gcc -ansi -pedantic in 9c. Fix many non-C89-isms.rsc2006-04-0111-20/+22
|
* update usagersc2006-03-203-8/+1
|
* update lucidarsc2006-03-203-2/+9
|
* warningsrsc2005-07-131-0/+1
|
* use full prototypesrsc2005-05-071-1/+1
|
* bug fix from plan 9rsc2005-03-181-2/+5
|
* remove debugging printrsc2005-01-271-1/+0
|
* add autoindent (-a) and chording.rsc2005-01-274-61/+42
| | | | clean up argument parsing.
* Many small edits.rsc2005-01-131-1/+1
|
* Goodbye SHORTLIBrsc2005-01-041-1/+0
|
* FreeBSD tweaksrsc2004-12-282-3/+4
|
* more little compile fixesrsc2004-12-282-8/+15
|
* use libplumb insteadrsc2004-06-092-10/+2
|
* allowrsc2004-05-143-6/+25
| | | | | | sam -r machine filelist... from presotto