aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2018-10-05fontsrv: copy some fixes from OS X to X11Fazlul Shahriar1-38/+43
* Avoid allocating empty images by adding 1 to width/height. This was crashing fontsrv. The total width of the subfont image can be zero even if the characters are present in the font. For example, all the characters in x0300.bit (part of "Combining Diacritical Marks" Unicode block) have zero width. * Make sure U+0000 is always present in the font, otherwise libdraw complains with: "stringwidth: bad character set for rune 0x0000 in ..." * Use the same fallback glyph (pjw face) as OS X. This also fixes a bug where advance was set to the total width of subfont instead of the character. Update #125 (most likely fixes the crash if in X11) Change-Id: Icdc2b641b8b0c08644569006e91cf613b4d5477f
2018-10-05upas/nfs: correctly quote IMAP LOGIN argumentsCharles Collicutt1-1/+1
According to RFC 3501 the arguments to the LOGIN command should be quoted strings (or length prefixed string literals). Without quoting, authentication to some IMAP servers (e.g. Dovecot) will fail.
2018-10-01grep: update from Plan 9David du Colombier1-3/+3
This change fixes a segfault in grep -e when no argument has been provided. Thanks to Sean Hinchee for reporting this issue. Fixes #186.
2018-09-29libregexp: include stddef.h in lib9.std.hDavid du Colombier1-0/+1
Commit 2d82ef9d98 added ptrdiff_t in regcomp.c. However, this change broke the build of the Unix package because ptrdiff_t is defined in stddef.h.
2018-09-19acme: Apply each -/+ only once (#156)Martin Kühl1-3/+3
When plumbing an address like `3-`, Acme selects line 1, and similarly `3+` selects line 5. The same problem can be observed for character addresses (`#123+`) but _not_ for ones like `+`, `.+` or `/foo/+`: The problem only occurs when a number is followed by a direction (`-`/`+`). Following along with the example `3-` through `address` (in addr.c): We read `3` into `c` and match the `case` on line 239. The `while` loop on line 242ff reads additional digits into `c` and puts the first non-digit back by decrementing the index `q`. Then we find the range for line 3 on line 251 and continue. On the next iteration, we set `prevc` to the last `c`, but since that part read ahead _into `c`_, `c` is currently the _next_ character we will read, `-`, and now `prevc` is too. Then in the case block (line 210) the condition on line 211 holds and Acme believes that it has read two `-` in sequence and modifies the range to account for the “first” `-`. The “second” `-` gets applied after the loop is done, on line 292. So the general problem is: While reading numbers, Acme reads the next character after the number into `c`. It decrements the counter to ensure it will read it again on the next iteration, but it still uses it to update `prevc`. This change solves the problem by reading digits into `nc` instead. This variable is used to similar effect in the block for directions (line 212) and fills the role of “local `c` that we can safely use to read ahead” nicely.
2018-06-26fontsrv: omit box-drawing characters from line struts on macOSIgor Burago1-1/+1
For some fonts, using box-drawing characters in the representative text for computing the line height results in it being uncomfortably high. Replace them with accented capitals and tall lower-case letters which lead to a more conservative increase in the line height. Fixes #162.
2018-03-27libdraw: fix error in the previous commitXiao-Yong Jin1-1/+1
2018-03-27mc: fix crash in acme with hidpi displayXiao-Yong Jin1-5/+9
2018-03-27samterm: free some getenv resultsXiao-Yong Jin1-2/+7
2018-03-27sam: freetmpstr instead of freeXiao-Yong Jin1-1/+1
2018-03-27libdraw: fix some memory leaks in font handlingXiao-Yong Jin5-6/+18
2018-03-27fontsrv: fix some memory leaksXiao-Yong Jin2-1/+4
2018-03-27devdraw: fix some memory leaks in x11Xiao-Yong Jin2-1/+5
2018-03-27acme: fix some memory leaksXiao-Yong Jin3-2/+8
2018-03-27fontsrv: enlarge drawing buffer for subfonts on macOSXiao-Yong Jin1-1/+3
Double the width returned by CTFontGetBoundingBox when drawing. Add box drawing characters for determining the line height. Call freememimage(1) for the character memimage. Fixes #18. Fixes #120. Fixes #146.
2018-03-27mount, 9pfuse: detect macports installed osxfuseXiao-Yong Jin1-0/+8
MacPorts installs osxfuse under /opt/local.
2018-03-23fontsrv: skip only the surrogate pairsMechiel Lukkien1-1/+1
fontsrv wasn't rendering fontawesome icons, which uses the private use area around 0xf000.
2018-03-239pserve: fix memory leak in warningRay Lai1-0/+2
2018-03-239term: Set TERM_PROGRAM to termprogMartin Kühl1-0/+1
TERM_PROGRAM is the customary way to identify which kind of terminal emulator program one uses on macOS. This change sets TERM_PROGRAM to termprog since both variables are used for the same purpose.
2018-03-239pfuse: retries read(3) upon EINTRXiao-Yong Jin1-2/+5
read(3) sometimes errors with EINTR on macOS over slow connections. 9pfuse(1) now retries read(3) instead of sysfatal(3)ing.
2018-02-059pfuse: fix handling of access mode (thanks Kenji Arisawa)David du Colombier1-1/+3
Fixes #81.
2018-01-23auxstats: get network stats in a portable manner on FreeBSDBakul Shah1-33/+14
as the old grody way doesn't work any more on FreeBSD-10 and later.
2018-01-17rc: use proper type for storing ulimit valuesRay Lai1-6/+7
rc on amd64 stores ulimit values as 32-bit int, but the limits on OpenBSD amd64 can exceed 2^31, so "ulimit -a" shows some values as negative. This is a problem when I want to increase my ulimit but the hard ulimit values are printed as negative.
2018-01-03gview: fix int vs ulong confusion causing silent exit 1 at startupRuss Cox1-4/+4
2017-11-279term: re-enable sys: child note for child processesRuss Cox1-0/+1
Fixes #6. Change-Id: Id9950f59c7970575866a7c22a69bfbf3a271f2bb
2017-11-02acme: preserve window position and selection during GetRuss Cox5-18/+103
Before, executing Get in a file rewound the window offset and selection to the start of the file. After this CL, Get preserves the window offset and selection, where preserve is defined as "the same line number and rune offset within the line". So if the window started at line 10 before and the selection was line 13 chars 5-7, then that will still be true after Get, provided the new content is large enough. This should help the common situation of plumbing a compiler error, realizing the window is out of date, clicking Get, and then losing the positioning from the plumb operation.
2017-10-14acme: free buf in checksha1Russ Cox1-0/+1
Thanks to Lorenzo Beretta for noticing.
2017-10-139term: fix getpts on macOS 10.13David du Colombier1-0/+16
Since macOS 10.13, opening the /dev/ptyXX files always return ENOENT. Consequently, we changed getpts to use openpty to open a pseudoterminal, like on Linux and OpenBSD. Fixes #90. Fixes #110.
2017-10-13upas/nfs: fix warningsDavid du Colombier3-10/+2
decode.c:146:8: warning: variable ‘argv’ set but not used fs.c:953:47: warning: variable ‘reset’ set but not used imap.c:348:6: warning: variable ‘prefix’ set but not used Updates #114.
2017-10-10acme: check file content before declaring file "modified since last read"Russ Cox23-13/+79
Bad remote file systems can change mtime unexpectedly, and then there is the problem that git rebase and similar operations like to change the files and then change them back, modifying the mtimes but not the content. Avoid spurious Put errors on both of those by checking file content. (False positive "modified since last read" make the real ones difficult to notice.)
2017-10-09devdraw: fix build on macOS < 10.12Rudá Moura1-0/+2
After making the build on macOS silent on commit 310ae03, the build was broken on macOS lesser than 10.12 (Sierra). This commit conditionally checks the version the of the SDK before using the defined values for silent build. Fixes #66.
2017-10-01xd: add -R for runewise dumpLeah Neukirchen1-40/+111
Ported from Plan 9 2013-05-21. https://github.com/0intro/plan9/commit/b377a116d132865c011a3fb3ea76528ffd32963f Closes #16.
2017-09-14all: remove .cvsignore filesKare Nuorteva22-62/+0
Rename following .cvsignore files to .gitkeep since they are required by the build (directories must exist before build): - bin/fossil/.gitkeep - bin/fs/.gitkeep - bin/venti/.gitkeep Change-Id: I9c2865058480cffb3a4613f25e2eca1f7e5578c0
2017-09-01lib9: import frand function from Plan 9David du Colombier2-0/+18
Fixes #15.
2017-09-01svgpic: fix warningsDavid du Colombier1-3/+1
plsvg.c:291:21: warning: variable ‘y2’ set but not used plsvg.c:291:17: warning: variable ‘x2’ set but not used
2017-09-01libmach: initialize ss variable in stabsline2pc functionDavid du Colombier1-1/+2
Fixes #58.
2017-09-01all: update site from swtch.com to 9fans.github.ioRuss Cox1-1/+1
2017-09-01ed: allow larger temp filesRuss Cox1-1/+1
Requested by rob.
2017-07-23venti: fix venti graph on 64-bitMichael Stroucken1-1/+1
A pixel is 32 bits wide in RGBA, regardless of system's word size. Change-Id: Iea36a8dafdec9ce8d593f944ef5ed1ea08e11d25 Reviewed-on: https://plan9port-review.googlesource.com/2980 Reviewed-by: David du Colombier <0intro@gmail.com>
2017-07-16acme: implement Cmd-Shift-Z for Redo on MacRuss Cox1-0/+4
Change-Id: Ie9332ed473609bd6ca156be0843dc5411cbf7b93 Reviewed-on: https://plan9port-review.googlesource.com/2941 Reviewed-by: Russ Cox <rsc@swtch.com>
2017-07-16devdraw: fix Mac Kcmd+ShiftRuss Cox1-0/+3
Change-Id: Ide32a9397701085b17fbd42f0866eb3de11e4190 Reviewed-on: https://plan9port-review.googlesource.com/2940 Reviewed-by: Russ Cox <rsc@swtch.com>
2017-06-19fontsrv: avoid quote mapping on fonts with indistinguishable quotesRuss Cox1-5/+19
Fixes #86. Change-Id: Id487219a0fcfdb68133fc81b11383365a1431c1c Reviewed-on: https://plan9port-review.googlesource.com/2922 Reviewed-by: Russ Cox <rsc@swtch.com>
2017-06-19lib9: fix needsrcquoteRuss Cox1-1/+1
As written, it is passing a rune to strchr, which likely ignores all but the bottom 8 bits of the rune. Long-standing Plan 9 bug too. Fixes #87. Change-Id: I6a833373b308bed8760d6989972c7f77b4ef3838 Reviewed-on: https://plan9port-review.googlesource.com/2921 Reviewed-by: Russ Cox <rsc@swtch.com>
2017-06-19svgpic: new program to convert pic to svgRuss Cox18-0/+4019
This is an experiment. Like tpic it's a copy-and-paste fork of pic. Change-Id: Ia22772bd5881c7904a6d8f8e0b46fde8cea89cbd Reviewed-on: https://plan9port-review.googlesource.com/2920 Reviewed-by: Russ Cox <rsc@swtch.com>
2017-05-05factotum: Fix an operator precedence bug in the secstore codeDan Cross1-1/+1
`==` is higher precedence than `&`. Parenthesize. Change-Id: I2c7ee588fea0d8a66e1c8424f26630015388d61a Signed-off-by: Dan Cross <cross@gajendra.net> Reviewed-on: https://plan9port-review.googlesource.com/2860 Reviewed-by: Gleydson Soares <gsoares@gmail.com>
2017-04-21yacc: Fix a bug from at least 1995.Dan Cross1-1/+2
Fix a bug folding newlines in strings constants in C code snippets in YACC. This code has existed since at least 2nd Edition Plan 9. Change-Id: Iba17b89a6529ac9fa6610bf0b44f551904174c26 Signed-off-by: Dan Cross <cross@gajendra.net> Reviewed-on: https://plan9port-review.googlesource.com/2840 Reviewed-by: Russ Cox <rsc@swtch.com>
2017-04-08libdraw: replace hand-rolled realloc, preventing buffer overflow.Ray Lai1-3/+1
The original buffer is f->nsubf*sizeof *subf bytes (oldsize) large. Once it's full, a new buffer of (f->nsubf+DSUBF)*sizeof *subf (newsize) is mallocated. Unfortunately memmove() reads (newsize) bytes from the original (oldsize) buffer, causing a buffer overflow. By switching to realloc(), we don't need to do buffer size calculation, memmoving, and freeing of the original buffer. Change-Id: Ibf85bc06abe1c8275b11acb1d7d346a14291d2cd Reviewed-on: https://plan9port-review.googlesource.com/1520 Reviewed-by: Gleydson Soares <gsoares@gmail.com>
2017-04-089term: Add missing parentheses, preventing buffer overflow.Ray Lai1-1/+1
(el-sr) is the string length and (sizeof wdir - strlen(name) - 20) is the buffer size. When the string length is greater than the buffer size, the beginning of the string is supposed to be trimmed to fit in the buffer size. Unfortunately a pair of parentheses were missing, pointing sr outside the buffer, and the for loop below then reads outside the buffer. For certain binary data printed in a window, it causes a segfault. Change-Id: Iffeaa348260ee2a5a36d9577308fb8d1c1688d05 Reviewed-on: https://plan9port-review.googlesource.com/1540 Reviewed-by: Gleydson Soares <gsoares@gmail.com>
2017-02-109pfuse: support osxfuse>=3.3.0James Porter1-7/+28
Change-Id: Ibca68261016b0f588e169e9f319748b5ba7d15ac Reviewed-on: https://plan9port-review.googlesource.com/2700 Reviewed-by: michaelian ennis <michaelian.ennis@gmail.com> Reviewed-by: Russ Cox <rsc@swtch.com>
2017-01-099term: c nitsRuss Cox2-2/+3
Change-Id: Ia18ebb28f24bc69f404004896f9ce54ddb53faf9 Reviewed-on: https://plan9port-review.googlesource.com/2782 Reviewed-by: Russ Cox <rsc@swtch.com>