summaryrefslogtreecommitdiffstats
path: root/src/cmd
Commit message (Collapse)AuthorAgeFilesLines
...
* clock: import from plan 9Russ Cox2020-01-131-0/+104
| | | | Fixes #250.
* devdraw: AUTOFRAMEWORK CoreFoundation on macOSRuss Cox2020-01-131-0/+1
| | | | Fixes #273.
* devdraw: x11 working againRuss Cox2020-01-1314-2340/+1844
| | | | | | | | Need to think a bit more about locking, but overall it's a working devdraw. Multiclient mode may not be working but nothing is using it yet.
* devdraw: multiclient modeRuss Cox2020-01-133-42/+115
|
* cmapcube: don't crash on initdraw failureRuss Cox2020-01-131-1/+2
|
* devdraw: more cleanup, clearer lockingRuss Cox2020-01-138-313/+329
|
* devdraw: refactor, clean up mac screenRuss Cox2020-01-137-505/+492
| | | | | Also turn mac-srv.c into a generic srv.c, so we can remove the duplication with x11-srv.c.
* devdraw: move per-window globals in mac-screen.m into ClientRuss Cox2020-01-133-62/+81
|
* devdraw: move Client into devdraw.h and move global state inRuss Cox2020-01-1310-464/+470
|
* devdraw: use consistent mac-* prefix on macOS filesRuss Cox2020-01-1312-200/+6
| | | | We were using osx- and cocoa- but it's not even OS X anymore.
* devdraw: can use libthread directly now on macOSRuss Cox2020-01-135-79/+13
|
* devdraw: simplify mac file namesRuss Cox2020-01-134-98/+5
| | | | | | Now that we only have Metal, we can drop the -metal. Also now that Carbon is gone we can drop the macargv.c, and then the -objc from object file names.
* devdraw: drop pre-metal macOS supportRuss Cox2020-01-133-1688/+5
| | | | | | | We didn't start using Metal until macOS 10.14, but it was available on 10.13, which is currently the oldest Apple-supported version of macOS. Simplify by deleting the old code.
* devdraw: update drawclient test program to run againRuss Cox2020-01-132-9/+8
|
* cmd/yacc: correctly detect end of file in gettokNeven Sajko2020-01-131-0/+2
| | | | | | This prevents an infinite loop. Change-Id: I7eda6b9d032ca0daeb24b555954330d07f35c78b
* cmd/yacc: check that arg is safe to pass to <ctype.h> isX functionsNeven Sajko2020-01-131-5/+14
| | | | | | | The functions from <ctype.h> require that their argument be representable as an unsigned char, anything else is an error. Change-Id: I9dafc49c431b7a2550b041603f27bac3c0010eea
* cmd/yacc: check for EOF in string constant in cpyactNeven Sajko2020-01-131-1/+1
| | | | Change-Id: I3b41ab3f181080bcff89201d30f0bdf8aa20d55c
* cmd/yacc: do not create an out of bounds pointerNeven Sajko2020-01-131-1/+2
| | | | | | | | | An out of bounds pointer/array index being created is an error in standard C. Updates #313 Change-Id: I7108fcde1a8e03017e9ab852adb737940489c827
* fontsrv: allow x11 hinting and disable autohint only (#254)Xiao-Yong2020-01-131-1/+1
| | | | | Some truetype fonts have good manual hinting. Ignoring hinting makes the font render badly on low resolution screens. This commit only disables the freetype autohinter, and allows hinting.
* Make venti's doc more accurateEdouard Klein2020-01-131-1/+1
|
* cmd/venti/srv: split memory allocation callNeven Sajko2020-01-131-2/+2
| | | | | | | | | | | This splits a certain vtmallocz call in mkihash into two vtmallocz calls. The first issue this fixes is that the C aliasing rules were not respected in the code before this commit. The other thing is that this enables better memory alignment guarantees. Updates #313 Change-Id: Ia4f3e0fc85facc778193f5e977d4f99a1a9abd23
* all: fix or silence various gcc warningsRuss Cox2020-01-1214-14/+17
| | | | | As usual, gcc finds some real problems but also reports a ton of noise. Fix the problems and quiet the noise.
* Trivial changes: whitespace and modes.Dan Cross2020-01-10700-4966/+4647
| | | | | | | | | 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>
* mk: plan9 style.Dan Cross2020-01-081-7/+8
| | | | | | | | In general, no space after `if` etc, and no braces for a single statement inside of a loop or conditional. Signed-off-by: Dan Cross <cross@gajendra.net>
* mk: fix out of bounds accessNeven Sajko2020-01-071-7/+21
| | | | | | | | | A loop is added for each structure field instead of accessing the other fields through the first one in one loop. Updates #313 Change-Id: I0e27e15feacb77391bc1decee7cf720d64d14586
* 9term: add a "look" menu item (#299)Fazlul Shahriar2020-01-073-0/+32
| | | | | | | Add a menu item which functions similar to acme's `Look` command. This is copied from 9front. See: https://code.9front.org/hg/plan9front/rev/1f1596dbca51 https://code.9front.org/hg/plan9front/rev/d2de1d2f7b48
* cmd/htmlroff: fix buffer overflow in t2.c getqargNeven Sajko2020-01-021-1/+1
| | | | | | | This is actually from 2016: https://plan9port-review.googlesource.com/c/plan9/+/1590 Change-Id: I6f2a3d71a9dd589eff7ab15b3c1d3997254b3c35
* ls: check that pointer is not nil before calling qsortNeven Sajko2020-01-021-1/+1
| | | | | | | Passing a null pointer to qsort is an error in C (GCC and Clang agree with the standards there, so this is no joke). Change-Id: Ia2b015793a75ea4e85ae8f47da6beead9c4290e6
* acme: do not pass null pointers where disallowedNeven Sajko2020-01-022-1/+4
| | | | | | The C standards disallow passing null pointers to memmove and memcmp. Change-Id: I1c88c2adbc32a23ef742f206038b8f7c4e0540c7
* cmd/rc: fix declarations of some externally linked variablesNeven Sajko2020-01-022-3/+2
| | | | Change-Id: If8fe1afecb9fe55f85e8e5af37521b83e787d718
* cb: fix a null pointer dereferenceNeven Sajko2020-01-021-3/+3
| | | | | | | | | | Just added a pair of parentheses. I also ran cb on cb.c to beautify the code. This is actually on Gerrit from 2016: https://plan9port-review.googlesource.com/c/plan9/+/1574 Change-Id: I5e234adba0f95c13d6eecb121bf11bba4bf54566
* sam: report close errorRuss Cox2019-12-193-1/+9
|
* acme: report close failure during PutRuss Cox2019-12-191-2/+6
|
* ed: formatting tweak (remove redundant tab). (#301)Marc Simpson2019-12-101-1/+1
|
* page: fix pdf prolog for ghostscript >= 9.27 (#296)Fazlul Shahriar2019-12-082-4/+2
| | | | | | | | Ghostscript 9.27 removed GS_PDF_ProcSet and pdfdict due to a security issue (see https://security-tracker.debian.org/tracker/CVE-2019-3839). This fix was contributed by @onyxperidot (see #279). Fixes #279
* ed: replace magic number (077776, i.e. 32766) with NBLK-1. (#300)Marc Simpson2019-12-081-1/+1
| | | | | | | Temp file size is now declared in an enum; changing it from the default introduces a subtle bug in putline(), which expects it to be 32767. Mask with NBLK-1 instead.
* page: fix hang for forward-only postscript filesFazlul Shahriar2019-11-142-1/+7
| | | | | | | | | | Page was hanging because ghostscript never closes the fd from which we're reading BMP data. We close our end of the pipe so that ghostscript will close its end. Tested with ghostscript version 9.50. Fixes #124
* plumber: add -f (foreground) option (#288)Jason Felice2019-10-293-4/+11
| | | | In MacOS, services run by launchd must run in the foreground, since launchd manages forking and other resources.
* awk: split record into runes for empty FS (#292)Fazlul Shahriar2019-10-291-4/+9
| | | | | | | | | | | | awk was splitting records into bytes instead of runes for empty FS. For example, this was printing only the first byte of the utf-8 encoding of é: echo é | awk 'BEGIN{FS=""}{print $1}' The change just copies how the `split` function handles runes. Originally reported by kris on twitter: https://twitter.com/p9luv/status/1180436083433201665
* hoc: don't nest calls to follow() when lexing ++/+= and --/-= (#287)deepcube2019-09-191-2/+2
| | | | | | | The code had a nested use of the follow() function that could cause +=+ and -=- to register as ++ and --. The first follow() to execute could consume a character and match and then the second follow() could consume another character and match. For example i-=-10 would result in a syntax error and i-=- would decrement i.
* upas/nfs: fix null date when message is sent to plumber (#263)telephil2019-09-191-1/+1
| | | | | | | | | When fetching, messages are sent to plumber as soon as the ENVELOPE part is read. The date field of the message is sent when the INTERNALDATE part is read and there is no guarantee that this will be read before the ENVELOPE. This bug can be observed when using faces(1) which will retrieve messages with a null date and then always display a 'Jan 1' date instead of the correct one. The fix is to simply send the message to plumber after having read all parts, thus ensuring the message is complete.
* plumber: fix EOF detection on writes to rules file (#257)Fazlul Shahriar2019-09-191-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of checking Fcall.data==nil, check Fcall.count==0. The former check always fails after `gcc -O2` optimizations (gcc version 8.3.0). Also fix an out-of-bound read detected by valgrind: ``` ==31162== Invalid read of size 1 ==31162== at 0x11005E: morerules (rules.c:739) ==31162== by 0x110254: writerules (rules.c:775) ==31162== by 0x10D2FE: fsyswrite (fsys.c:848) ==31162== by 0x10C304: fsysproc (fsys.c:248) ==31162== by 0x112E8C: threadstart (thread.c:96) ==31162== by 0x4A682BF: ??? (in /usr/lib/libc-2.29.so) ==31162== Address 0x4ea984a is 0 bytes after a block of size 250 alloc'd ==31162== at 0x483AD7B: realloc (vg_replace_malloc.c:826) ==31162== by 0x1196F3: p9realloc (malloc.c:53) ==31162== by 0x10BDFD: erealloc (plumber.c:124) ==31162== by 0x10FCD9: concat (rules.c:642) ==31162== by 0x10FCD9: concat (rules.c:635) ==31162== by 0x110230: writerules (rules.c:773) ==31162== by 0x10D2FE: fsyswrite (fsys.c:848) ==31162== by 0x10C304: fsysproc (fsys.c:248) ==31162== by 0x112E8C: threadstart (thread.c:96) ==31162== by 0x4A682BF: ??? (in /usr/lib/libc-2.29.so) ``` Fixes #256
* auxstats: replace /proc ACPI calls with /sys ones (#245)Zach Scott2019-09-191-22/+8
| | | | | | According to <https://askubuntu.com/a/309146>, use of `/proc/acpi` to get battery usage is deprecated. This commit replaces the two files from this API with the single file `/sys/class/power_supply/BAT0/capacity`, simultaneously removing the need to calculate battery percentage.
* devdraw: cocoa metal screen adds a delayed update (#270)Xiao-Yong2019-06-191-0/+7
| | | | | | | The immediate display of the screen sometimes miss the update from the CPU side memory. No obvious synchronization mechanism is available. In order to make sure the screen updates properly, we set needsDisplay again after 16ms delay to ensure a second screen update.
* devdraw: handle windowDidResize on macOS (#212)Pocket78782019-06-111-1/+7
| | | | This supports non-live window resize.
* acme: accept expanded URLs in lookRuss Cox2019-06-101-9/+39
| | | | | | | Just as look expands a click in /etc/passwd to the full name (provided that file exists), it now expands a click in https://9fans.net/ to the full URL (provided the prefix is http:// or https://). Probably more adjustment is needed.
* acme: delete trailing spaces during Put in autoindent modeRuss Cox2019-05-171-41/+64
| | | | | | | Autoident mode is the leading cause of trailing spaces on lines. Remove them during Put to make various picky tools happier. The changes during Put are added as a separate entry to the file history, so that the first Undo after Put restores the spaces.
* devdraw: cocoa metal screen updates (#215)Xiao-Yong2019-05-171-63/+27
| | | | | | | | | | | | | | | | * devdraw: cocoa metal screen uses a dirty hack to make everything smooth * devdraw: cocoa metal screen uses a layer to make fullscreen applications behave * devdraw: macOS cocoa metal fix resizeimg without img * devdraw: macOS cocoa metal uses blit instead of render We directly use the blit command encoder to copy texture to the framebuffer. We no longer need to compile the metal shader every time the application starts just for rendering a flat 2D surface. * travis: add osx images covering 10.13 and 10.14
* acme: do not trim spaces during PutRuss Cox2019-04-191-4/+8
| | | | | | | The commit that introduced this was pushed accidentally. It is not a good idea to do this. (It breaks programs that think that a clean window means the body matches the on-disk file.)
* samterm: stop ignoring all keys >= KcmdPocket78782019-04-051-2/+3
|