Commit graph

3903 commits

Author SHA1 Message Date
David Arnold
4938281a82 Fix tyop 2023-01-09 17:03:29 -05:00
Russ Cox
43f5af9c8d acme: allow larger paste amounts 2023-01-06 12:04:17 -05:00
Russ Cox
940f1fd6af page: scale ppi on high-res displays
Also fix wording of -w warning.
2023-01-06 12:04:17 -05:00
Tom Schwindl
ffbdd1aa20 rio: check the return value of malloc(3) 2022-09-12 10:35:36 -04:00
MvA
846f724983 fix double free bug, simplify error handling, reduce X11 calls 2022-09-11 09:55:17 -04:00
MvA
3e764832bc fix double free bug, simplify error handling, reduce X11 calls, improve style 2022-09-11 09:55:17 -04:00
Derek Stevens
52be2761ae fix indentation 2022-09-07 12:24:01 -04:00
Derek Stevens
0a846f5f0f acme/wind.c: redraw window body with bg color if too small for a single line; ref #10 2022-09-07 12:24:01 -04:00
Tw
9dab36f2af factotum: fix log read inuse bug
When log reading exits, inuse flag should be cleared.

Signed-off-by: Tw <wei.tan@intel.com>
2022-09-07 09:34:32 -04:00
Igor Burago
c57b71966e acme: accept paths with spaces in the 'name' ctl message
As it is allowed to use spaces in file names set interactively through
the tag since 7b1c85f, do not reject names with spaces in the 'name'
ctl message either.

Fixes #559.
2022-09-07 09:32:08 -04:00
Igor Burago
29fae81fb7 plumber: allow underscores in variable names in plumbing rules
Fixes #561.
2022-09-07 09:31:36 -04:00
Igor Burago
4f801be055 plumber: set match variables past the first non-matching subexpression
Fixes #563.
2022-09-07 09:30:40 -04:00
mmnmnnmnmm
28e91cd879 web: fix plumbing with Firefox
Default builds of Firefox remove the previous X remote interface,
now causing the use of -remote to silently exit and do nothing.

https://hg.mozilla.org/mozilla-central/rev/ef22d8cbf4ef
2022-09-06 13:21:47 -04:00
Igor Burago
e4b913866b plumber: fail on buffer exhaustion or runaway quotes in string expansion 2022-09-06 13:21:23 -04:00
Tom Schwindl
a4af25bc0d src/cmd: print all usage messages to stderr
All utilities print their usage message to stderr,
cmp(1) and getflags(8) should do the same.
2022-09-06 13:15:36 -04:00
mmnmnnmnmm
7b8251125b add macedit to moveplan9.files 2022-08-18 10:48:50 -04:00
mmnmnnmnmm
ffdca8f730 9l: without arguments, exit instead of failing to link nothing
Found in Arch Linux but never reported upstream:
https://bugs.archlinux.org/task/55640
2022-08-18 10:48:20 -04:00
mmnmnnmnmm
10e46bde5a
Modernise terminology (#573) 2022-08-18 10:47:17 -04:00
g-branden-robinson
93f8143600
troff: support \~ as an alias for \ (#567)
In groff, Heirloom Doctools troff, and neatroff, the `\~` escape
sequence produces an adjustable (paddable) but unbreakable space.
mandoc, which does not perform adjustment or render to typesetters,
supports the escape sequence as a synonym for `\ `, the same as `\0`.

This extension is of long pedigree: groff has supported it for at least
30 years, Heirloom for 17, mandoc for 13, and neatroff for 6.

Do the same as mandoc to prevent mis-rendering of documents using this
escape sequence.  Heirloom Doctools troff, a descendant of Documenter's
Workbench troff, would be a good place to look for a compatible
implementation of the adjustable semantics for this sequence.
2022-08-12 23:37:28 -04:00
Lincerely
506de8f6d4
Fix fonts (#463)
* font/pelm: add cjk punctuation for hku.9.font
* troff: added back HX
2022-07-27 10:25:51 -04:00
Karsten Pedersen
0ebf279d89 Fixed a use after free in rio.
Screen was being queried from within a client after it had been free'd.
2022-07-27 10:19:26 -04:00
Sören Tempel
45124b23d2 upas: don't hardcode path for rc(1) 2022-07-27 10:15:51 -04:00
Sören Tempel
c53230037a sam: use get9root instead of duplicating the logic 2022-07-27 10:15:51 -04:00
Sören Tempel
521fc08180 lib9: pass $PLAN9_TARGET via CPP for get9root fallback value
Allows this function to always return the proper path in situations
where the $PLAN9 environment variable is not set, i.e. a rc login shell.
2022-07-27 10:15:51 -04:00
Sören Tempel
f7b572818c INSTALL: Always set PLAN9_TARGET environment variable
That is, not only when -r was given. This allows using this veriable in
mkfiles across the code base.
2022-07-27 10:15:51 -04:00
camsn0w
005ee081d5 Added a paren to fix a warning in u.h 2022-07-26 18:27:34 -04:00
lufia
8d5bcf7e1e factotum: plug a memory leak in apop 2022-07-26 12:19:14 -04:00
Xiao-Yong Jin
1fcdefc585 fontsrv: always compute new height and ascent for the font file 2022-07-26 12:15:07 -04:00
Xiao-Yong Jin
85bfd19a7b devdraw/x11: fix modifier key handling for some XkbOptions
Certain XkbOptions in X11 would change keysyms for modifier keys
between the key press and key release.

For example, under the XkbOptions "grp:shifts_toggle", though shift
keys remain Shift_L/R when pressed, they become ISO_Group_Next/Prev
when released.

This behavior makes devdraw unable to detect the release event
correctly and as a result mouse button 1 click always interpreted
as button 3 event after a shift key is used.
2022-07-26 12:13:13 -04:00
Igor Böhm
07b24459ea Bail out if convW2M(...) indicates failure. 2022-07-26 12:12:05 -04:00
Igor Böhm
d92ac2d1b4 libdraw: fix out-of-bounds access to local buffer in event.c:startrpc()
The function `startrpc()` stack allocates a local buffer of size 100:

```c
static Muxrpc*
startrpc(int type)
{
	uchar buf[100];
	      ^^^^^^^^
	Wsysmsg w;

	w.type = type;
	convW2M(&w, buf, sizeof buf);
	return muxrpcstart(display->mux, buf);
}
```

The function `convW2M()` is called passing `buf`. That function accesses
`buf` out-of-bounds:

```c
uint
convW2M(Wsysmsg *m, uchar *p, uint n)
{
  ...
  case Tcursor2:
    PUT(p+6, m->cursor.offset.x);
    PUT(p+10, m->cursor.offset.y);
    memmove(p+14, m->cursor.clr, sizeof m->cursor.clr);
    memmove(p+46, m->cursor.set, sizeof m->cursor.set);
    PUT(p+78, m->cursor2.offset.x);
    PUT(p+82, m->cursor2.offset.y);
    memmove(p+86, m->cursor2.clr, sizeof m->cursor2.clr);
    memmove(p+214, m->cursor2.set, sizeof m->cursor2.set);
    p[342] = m->arrowcursor;
    ^^^^^^
```

To fix the issue the size of local variable `buf` is increased from 100
to 512 to avoid out-of-bounds array access.
2022-07-26 12:12:05 -04:00
Fazlul Shahriar
2ca8ede24a fossil: fix EOF detection when reading 9P message
When the 9P connection is closed, reads on the connection will keep
returning 0. So, fossil ends up looping forever, trying to read a 9P
message, consuming 100% CPU. The fix interprets 0 bytes read as EOF.

Reproduce by killing the 9pserve process serving the fossil service, or
by listening on tcp and using 9p(1).
2022-07-26 12:11:38 -04:00
mmnmnnmnmm
23420c2493 deroff: fix out-of-bounds access if runes above 0X80 are inside EQ clauses 2022-07-26 12:09:57 -04:00
Andriy Symonovych
a2422a89c5 trim button & modbutton images 2022-07-26 12:08:03 -04:00
Andriy Symonovych
6f35cfa6b6 make sure border has correct height 2022-07-26 12:07:00 -04:00
Kyle Nusbaum
bb4b8acc26 src/cmd/fontsrv: pad subfile names to support correct file length
For fonts with subfiles that go beyond the xffff range, the font file size
calculation is incorrect, since lines beyond that range have additional
characters. This patch pads all of the ranges and subfont names with
leading zeros in order to keep them all lines the same length and fixes the
font file length calculation.
2022-07-26 12:06:12 -04:00
Ben Huntsman
686f5d035c acme: Don't move the mouse if button depressed
Fixes #19
2022-07-26 12:04:01 -04:00
Ori Bernstein
964ac74cdc rc: remove dead code.
kencc warns that this code is dead.
2022-05-11 21:51:47 +00:00
Ben Huntsman
8bf462f339 man/man3/stat.3: Update man page to match include/libc.h. Resolves Issue #530 2022-05-11 21:46:32 +00:00
Russ Cox
bab7b73b85 INSTALL: build arm64 binaries on arm64 Macs
If there is any x86 binary in the chain of parent processes from
the current one, then uname -m prints x86_64 and clang
defaults to building x86_64 binaries.

Detect arm64 using the kernel version and force building
an arm64 toolchain instead of perpetuating x86.

This is particularly important when the user shell is rc,
which has been built for x86, because then rebuilding
under rc continues to use x86.
2022-01-24 13:47:27 -05:00
Roger Peppe
d0d440860f
src/cmd/acme: provide info on presense or absence of undo history (#528)
It's sometimes useful to know whether there's been editing activity
in a window. This PR adds that information to the ctl file.

Change-Id: I21a342ac636dd5c7701b3ed560e3526867329c2c
2021-10-19 12:08:45 -04:00
Nicola Girardi
7b0b2065fa cmd/auxstats: improve network device name matcher in Linux 2021-10-18 16:41:11 -04:00
Nic
0ac2a105ae cmd/auxstats: improve wireless interface name matcher in Linux 2021-10-17 14:08:16 -04:00
Dan Cross
e683bdfa76 mk: provide a mechanism to default to rc
For cross-compiling plan9 from Unix, provide a way
to force `mk` to use `rc` instead of `sh` without
setting `MKSHELL` in individual `mkfile`s.

If the environment variable `FORCERCFORMK` is set,
`mk` will default to using `rc`, not `sh`.

Signed-off-by: Dan Cross <cross@gajendra.net>
2021-10-05 08:24:37 -04:00
Russ Cox
d3ee9f70e4 sam: fix spurious overwrite message
Fixes:

% sam -d
 -.
w foo
foo: (new file) #0
w foo
?warning: write might change good version of `foo'
2021-09-30 08:44:00 -04:00
Russ Cox
8cf52696be acme: fix extra print args 2021-09-28 13:07:33 -04:00
Alexander Kapshuk
ceb1ab90ff lib9p: Fix compile error
commit 385a6d5877 removed src/lib9p/_post.c
from the code base, but overlooked removing a reference to the
_post.o object file from the src/lib9p/mkfile.

This results in lib9p failing to compile:

* Running on Darwin...
* Compiler version:
	Apple clang version 12.0.5 (clang-1205.0.22.11)
* Building mk...
* Building everything (be patient)...
>>> mk: don't know how to make '/Users/sasha/plan9port_fork/lib/lib9p.a(_post.o)' in /Users/sasha/plan9port_fork/src/lib9p
mk: for i in ...  : exit status=exit(1)

Remove _post.o from the list of dependent object files from
src/lib9p/mkfile to have lib9p compile.

Fixes: 385a6d5877 ("lib9p: Remove postmountsrv (#505)")
2021-09-01 08:40:44 -04:00
Ben Huntsman
385a6d5877 lib9p: Remove postmountsrv (#505) 2021-08-30 21:03:41 -04:00
Ben Huntsman
aa01c23be6 .gitignore: Ignore some more things that get created during compile. 2021-08-30 21:02:29 -04:00
Ben Huntsman
d356d2a8b2 9term: Skip unnecessary ioctl call on AIX. 2021-08-30 19:40:49 -04:00