<feed xmlns='http://www.w3.org/2005/Atom'>
<title>plan9port/src/cmd/sam, branch patch</title>
<subtitle>Plan 9 from User Space (with patches)</subtitle>
<link rel='alternate' type='text/html' href='https://git.rctt.net/plan9port/'/>
<entry>
<title>all: remove need for `-fcommon`</title>
<updated>2025-07-25T16:25:11+00:00</updated>
<author>
<name>Dan Cross</name>
<email>cross@gajendra.net</email>
</author>
<published>2025-07-23T10:47:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rctt.net/plan9port/commit/?id=156e745be9f6a1b19b0f8e2a931148786d7acad4'/>
<id>156e745be9f6a1b19b0f8e2a931148786d7acad4</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
<entry>
<title>sam: use get9root instead of duplicating the logic</title>
<updated>2022-07-27T14:15:51+00:00</updated>
<author>
<name>Sören Tempel</name>
<email>soeren+git@soeren-tempel.net</email>
</author>
<published>2021-10-31T00:30:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rctt.net/plan9port/commit/?id=c53230037ac8ebed34ff8bf1af0a94aea0843c2e'/>
<id>c53230037ac8ebed34ff8bf1af0a94aea0843c2e</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>sam: fix spurious overwrite message</title>
<updated>2021-09-30T12:44:00+00:00</updated>
<author>
<name>Russ Cox</name>
<email>rsc@swtch.com</email>
</author>
<published>2021-09-30T12:44:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rctt.net/plan9port/commit/?id=d3ee9f70e4ee00bd12557910c9e3dcc1fabd53c7'/>
<id>d3ee9f70e4ee00bd12557910c9e3dcc1fabd53c7</id>
<content type='text'>
Fixes:

% sam -d
 -.
w foo
foo: (new file) #0
w foo
?warning: write might change good version of `foo'
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes:

% sam -d
 -.
w foo
foo: (new file) #0
w foo
?warning: write might change good version of `foo'
</pre>
</div>
</content>
</entry>
<entry>
<title>sam: avoid out-of-bounds read in rterm</title>
<updated>2021-01-14T15:05:50+00:00</updated>
<author>
<name>Russ Cox</name>
<email>rsc@swtch.com</email>
</author>
<published>2021-01-14T15:05:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rctt.net/plan9port/commit/?id=3ccd61629b641613bcccbc51125330efab9c89a7'/>
<id>3ccd61629b641613bcccbc51125330efab9c89a7</id>
<content type='text'>
Usually r-&gt;nused &lt; r-&gt;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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Usually r-&gt;nused &lt; r-&gt;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.
</pre>
</div>
</content>
</entry>
<entry>
<title>sam: remove backward ?:</title>
<updated>2021-01-14T15:01:25+00:00</updated>
<author>
<name>Russ Cox</name>
<email>rsc@swtch.com</email>
</author>
<published>2021-01-14T15:01:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rctt.net/plan9port/commit/?id=6a80119eb509bd948d87ad1b84b0a82855a3c691'/>
<id>6a80119eb509bd948d87ad1b84b0a82855a3c691</id>
<content type='text'>
The exit code here is ignored anyway.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The exit code here is ignored anyway.
</pre>
</div>
</content>
</entry>
<entry>
<title>acme, sam, samterm: remove weird switch usage</title>
<updated>2021-01-06T04:38:09+00:00</updated>
<author>
<name>Russ Cox</name>
<email>rsc@swtch.com</email>
</author>
<published>2021-01-06T04:38:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rctt.net/plan9port/commit/?id=1c845e0bd5ff897dc5e90f2c24db4ecd81a8f60c'/>
<id>1c845e0bd5ff897dc5e90f2c24db4ecd81a8f60c</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
<entry>
<title>sam: rm dregs</title>
<updated>2021-01-06T04:37:04+00:00</updated>
<author>
<name>Russ Cox</name>
<email>rsc@swtch.com</email>
</author>
<published>2021-01-03T05:54:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rctt.net/plan9port/commit/?id=0a513e65607223d11ba94003256b13ef5779e7e8'/>
<id>0a513e65607223d11ba94003256b13ef5779e7e8</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>stats: add threadmaybackground</title>
<updated>2021-01-06T04:37:04+00:00</updated>
<author>
<name>Russ Cox</name>
<email>rsc@swtch.com</email>
</author>
<published>2021-01-06T04:35:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rctt.net/plan9port/commit/?id=7f6458b045e04b97dd06b3171ac67e9ecde32429'/>
<id>7f6458b045e04b97dd06b3171ac67e9ecde32429</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>all: a few more #define tricks for AIX</title>
<updated>2020-08-16T00:46:23+00:00</updated>
<author>
<name>Russ Cox</name>
<email>rsc@swtch.com</email>
</author>
<published>2020-08-16T00:46:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rctt.net/plan9port/commit/?id=1f098efb7370a0b28306d10681e21883fb1c1507'/>
<id>1f098efb7370a0b28306d10681e21883fb1c1507</id>
<content type='text'>
This should make the AIX build finally work.

Fixes #400.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This should make the AIX build finally work.

Fixes #400.
</pre>
</div>
</content>
</entry>
<entry>
<title>Trivial changes: whitespace and modes.</title>
<updated>2020-01-10T14:54:30+00:00</updated>
<author>
<name>Dan Cross</name>
<email>cross@gajendra.net</email>
</author>
<published>2020-01-10T14:44:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rctt.net/plan9port/commit/?id=fa325e9b42b0bdfb48857d1958d9fb7ceac55151'/>
<id>fa325e9b42b0bdfb48857d1958d9fb7ceac55151</id>
<content type='text'>
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 &lt;cross@gajendra.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;cross@gajendra.net&gt;
</pre>
</div>
</content>
</entry>
</feed>
