Steve McCoy
1889a25783
rcmain: use new $termprog variable
...
R=rsc
CC=plan9port.codebot
https://codereview.appspot.com/12505045
2013-08-13 12:46:38 -04:00
Russ Cox
1670a244d9
devdraw: set window name to argv[0]
...
R=rsc
CC=r
https://codereview.appspot.com/12577043
2013-08-06 23:44:06 -04:00
Russ Cox
bf63f986ff
9term: set TERM=dumb instead of TERM=9term
...
Everyone seems to assume that TERM != dumb implies
ANSI escape codes are okay. In fact, many people assume
that unconditionally, but it is easier to argue back about
TERM=dumb than TERM=9term.
This applies to acme win too, because they share the code.
Set termprog=9term or termprog=win for clients who
need to know.
R=rsc
CC=r
https://codereview.appspot.com/12532043
2013-08-06 09:42:10 -04:00
Russ Cox
2bc9a13faf
acme: allow :6 in 5-line file
...
R=rsc
https://codereview.appspot.com/12162043
2013-07-31 09:15:30 -04:00
Roger Peppe
d74fdb6edb
cmd/devdraw: clear keyboard state on lost focus.
...
See https://bitbucket.org/rsc/plan9port/issue/128/alt-button-sticks-in-acme-sometimes-after
R=rsc
https://codereview.appspot.com/11453043
2013-07-17 17:55:09 +01:00
David du Colombier
3d31240bfd
libregexp: update from Plan 9
...
R=rsc
https://codereview.appspot.com/10690044
2013-07-02 06:39:17 +02:00
Russ Cox
da3ed55e4e
devdraw: fix x11 input
...
R=rsc
https://codereview.appspot.com/10458043
2013-06-21 15:28:02 -04:00
Xi Wang
1bfec89b99
rc: avoid undefined C
...
There are two bugs in pdec() on INT_MIN:
* wrong output.
`n = 1-n' should be `n = -1-n' when n is INT_MIN.
* infinite loop.
gcc optimizes `if(n>=0)' into `if(true)' because `-INT_MIN' (signed integer overflow) is undefined behavior in C, and gcc assumes the negation of a negative number must be positive. The resulting binary keeps printing '-' forever given INT_MIN.
Try the simplified pdec.c below.
$ gcc pdec.c
$ ./a.out -2147483648
--214748364*
$ gcc pdec.c -O2
$ ./a.out -2147483648
<infinite loop>
$ gcc pdec.c -O2 -D__PATCH__
$ ./a.out -2147483648
-2147483648
=== pdec.c ===
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
#define io void
void pchr(io *f, int c)
{
putchar(c);
}
void pdec(io *f, int n)
{
if(n<0){
#ifndef __PATCH__
n=-n;
if(n>=0){
pchr(f, '-');
pdec(f, n);
return;
}
/* n is two's complement minimum integer */
n = 1-n;
#else
if(n!=INT_MIN){
pchr(f, '-');
pdec(f, -n);
return;
}
/* n is two's complement minimum integer */
n = -(INT_MIN+1);
#endif
pchr(f, '-');
pdec(f, n/10);
pchr(f, n%10+'1');
return;
}
if(n>9)
pdec(f, n/10);
pchr(f, n%10+'0');
}
int main(int argc, char **argv)
{
int n = atoi(argv[1]);
pdec(NULL, n);
putchar('\n');
}
R=rsc
CC=plan9port.codebot
https://codereview.appspot.com/7241055
2013-03-19 14:36:50 -04:00
Xi Wang
8a2a5b8f25
libsec: avoid undefined C
...
gcc compiles `p + length < p' into 'length < 0' since pointer overflow is undefined behavior in C. This breaks the check against a large `length'.
Use `length > pend - p' instead.
There's no need to check `length < 0' since `length' is from length_decode() and should be non-negative.
===
Try the simplified code.
void bar(void);
void foo(unsigned char *p, int length)
{
if (p + length < p)
bar();
}
$ gcc -S -o - t.c -O2
...
foo:
.LFB0:
.cfi_startproc
testl %esi, %esi
js .L4
rep
ret
.L4:
jmp bar
.cfi_endproc
Clearly `p' is not used at all.
R=rsc
CC=plan9port.codebot
https://codereview.appspot.com/7231069
2013-03-19 14:35:16 -04:00
Russ Cox
01e3847b7e
xd: accept -S for 8-byte swap
...
R=rsc
https://codereview.appspot.com/7565045
2013-03-11 17:26:11 -04:00
Russ Cox
36bb28dc63
devdraw: control+click = button 2, alt/shift+click = button 3
...
For single-button mouse users.
R=rsc
https://codereview.appspot.com/7620043
2013-03-07 22:40:47 -05:00
Russ Cox
17934beda0
devdraw: silence unused variable warnings
...
R=rsc
https://codereview.appspot.com/7304064
2013-02-08 12:46:59 -05:00
Russ Cox
5154e54d8b
devdraw: disable XCopyArea optimization
...
Ubuntu Precise seems to have a buggy X server
that sometimes fails at XCopyArea. Let devdraw
do it itself.
This will slow down remote X a little bit,
but slow and correct is better than fast and broken.
R=rsc
https://codereview.appspot.com/7310069
2013-02-08 12:44:56 -05:00
Alessandro Arzilli
cac1425c4a
fontsrv: fix on X11 when X11H is not defined
...
R=rsc
CC=plan9port.codebot
https://codereview.appspot.com/7228044
2013-01-30 17:46:16 -08:00
Xi Wang
0dc3aa4b1d
libmach: fix crash in dwarfpc (misuse of realloc)
...
R=rsc
CC=plan9port.codebot
https://codereview.appspot.com/7225059
2013-01-30 17:46:12 -08:00
Martin Neubauer
dad9d0ac8f
fontserv: fix build on FreeBSD 9.1
...
R=rsc
https://codereview.appspot.com/7095050
2013-01-30 17:45:28 -08:00
Russ Cox
0497ad9724
CONTRIBUTORS: three more
...
R=rsc
https://codereview.appspot.com/7225073
2013-01-30 17:45:21 -08:00
David du Colombier
d5baaf984f
jpegdump: fix build and warnings
...
R=rsc
https://codereview.appspot.com/7070070
2013-01-19 10:05:12 +01:00
David du Colombier
23efb34d47
freq: fix crash with utf > 0xffff (thanks Andrey Mirtchovski)
...
R=rsc
https://codereview.appspot.com/7029054
2013-01-04 20:06:08 +01:00
David du Colombier
0798d6b741
venti/wrarena: fix arenapart breakage
...
R=rsc
https://codereview.appspot.com/7027044
2013-01-03 06:48:36 +01:00
Russ Cox
cb71c0bdc4
fontsrv: only build when the pieces are there
2012-12-18 07:22:19 -08:00
Christian Kellermann
1a512ec048
fontsrv: fix build on OpenBSD 5.2
...
R=rsc
CC=plan9port.codebot
https://codereview.appspot.com/6850108
2012-12-11 12:45:45 -05:00
David du Colombier
0b4fd92105
auth/factotum: fix password prompt hang with secstore
...
R=rsc
http://codereview.appspot.com/6906057
2012-12-09 11:24:30 +01:00
Russ Cox
09adcb0901
fontsrv: make single quotes look like quotes
...
R=rsc
https://codereview.appspot.com/6864051
2012-12-03 15:55:13 -05:00
Russ Cox
1785490baa
fontsrv: scaled pjw
...
R=rsc
https://codereview.appspot.com/6854130
2012-12-01 00:35:06 -05:00
Russ Cox
c96d832508
acme: retina scaling for scroll bars, button
...
R=rsc
http://codereview.appspot.com/6854094
2012-11-26 00:33:05 -05:00
Russ Cox
c28224992a
samterm: retina scaling for scroll bars, borders
...
R=rsc
http://codereview.appspot.com/6844083
2012-11-26 00:23:06 -05:00
Russ Cox
a8a0a6422c
9term: adjust to dpi changes
...
R=rsc
http://codereview.appspot.com/6847105
2012-11-26 00:13:18 -05:00
Russ Cox
94dae4befc
libdraw: change DefaultDPI to 133
...
Let's see if that's any better.
R=rsc
http://codereview.appspot.com/6850103
2012-11-26 00:13:04 -05:00
Russ Cox
58b1904e3e
devdraw: fake dpi calculation on Mac
...
R=rsc
http://codereview.appspot.com/6782115
2012-11-25 23:55:27 -05:00
Russ Cox
cc9547960e
libframe: auto scale tick for retina
...
R=rsc
http://codereview.appspot.com/6850102
2012-11-25 23:48:19 -05:00
Russ Cox
ffaaaf9dae
devdraw: use %R not Fn-F3 for retina toggle
...
R=rsc
http://codereview.appspot.com/6854093
2012-11-25 23:47:54 -05:00
Russ Cox
55905845f3
devdraw: add forcedpi toggled by Fn+F3 on Mac
...
R=rsc
http://codereview.appspot.com/6846104
2012-11-25 23:38:14 -05:00
Marius Eriksen
2589c5c6ee
acme: set $samfile (same as $%) during execution
...
R=rsc
CC=plan9port.codebot
http://codereview.appspot.com/6854092
2012-11-25 22:56:08 -05:00
Russ Cox
e19fde3584
fontsrv: work around a few crashes
...
Probably not the right fix, but gets us going.
R=rsc
http://codereview.appspot.com/6782113
2012-11-25 22:45:32 -05:00
Russ Cox
c6d1f20537
devdraw: fix retina mode
...
R=rsc
http://codereview.appspot.com/6847104
2012-11-25 22:43:57 -05:00
Russ Cox
9f3851871e
libdraw: add scalesize
...
R=rsc
http://codereview.appspot.com/6855092
2012-11-25 22:15:57 -05:00
Russ Cox
323e7d0193
draw.h: add DefaultDPI
...
R=rsc
http://codereview.appspot.com/6858071
2012-11-25 22:02:02 -05:00
Russ Cox
d0e0701913
devdraw, libdraw: add display->dpi
...
Fixed at 100 right now, but the plan is to make it accurate
and then use it.
R=rsc
http://codereview.appspot.com/6856091
2012-11-25 21:41:52 -05:00
Shenghou Ma
7b9ef735a8
devdraw: restore compilation on OS X 10.6
...
Also add some ignored files to .hgignore
R=rsc
http://codereview.appspot.com/6842089
2012-11-25 21:20:18 -05:00
Russ Cox
9ca6e21f3d
acme: use threadspawnd to avoid changing "." of current process
...
R=rsc
http://codereview.appspot.com/6736060
2012-10-22 12:32:31 -04:00
Russ Cox
9e4b56e764
libthread: add threadspawnd
...
R=rsc
http://codereview.appspot.com/6742064
2012-10-22 12:32:09 -04:00
Marius Eriksen
81c2c5e775
acme: add $acmeshell to control execution shell
...
R=rsc
CC=plan9port.codebot
http://codereview.appspot.com/6614056
2012-10-21 16:52:08 -04:00
Yuval Pavel Zholkover
9c61127928
fontsrv: x11 support
...
R=rsc, 0intro
CC=plan9port.codebot
http://codereview.appspot.com/6739047
2012-10-21 16:49:13 -04:00
Rob Kroeger
e13727e3c4
plumb.app: accept plumb:foo as alias for foo
...
R=rsc
CC=plan9port.codebot
http://codereview.appspot.com/5495046
2012-10-21 12:53:33 -04:00
Caio Oliveira
e4122a42b9
devdraw: map X11 dead_diaresis to double quote
...
R=rsc
CC=plan9port.codebot
http://codereview.appspot.com/6690049
2012-10-21 12:12:00 -04:00
Erik Quanstrom
33cdf63251
libmemdraw: fix int size bug
...
R=rsc, quanstro
CC=plan9port.codebot
http://codereview.appspot.com/6657043
2012-10-21 12:08:49 -04:00
Russ Cox
c5bfba483f
silence more warnings
...
R=rsc
http://codereview.appspot.com/6744056
2012-10-21 12:04:56 -04:00
Russ Cox
b0ae8a46a0
9c: support clang on Mac
...
R=rsc
http://codereview.appspot.com/6744055
2012-10-21 12:01:13 -04:00
Russ Cox
0cfb376070
fix clang warnings reported by Tuncer Ayaz
...
R=rsc
http://codereview.appspot.com/6744054
2012-10-21 11:25:08 -04:00