Commit graph

3399 commits

Author SHA1 Message Date
Rob Pike
5a69e405fc acme: scroll a directory window when navigating if:
- the cursor is on the last line
        - the navigation would put the cursor over the tag of the following text

R=rsc
CC=smckean83
https://codereview.appspot.com/15280045
2013-10-22 16:47:48 -07:00
David du Colombier
075c3bdc54 xd: fix build by declaring swizz8
R=rsc
https://codereview.appspot.com/13982043
2013-09-26 22:34:05 +02:00
David du Colombier
25f54d6f52 fossil: cleanup mkfile
R=rsc
https://codereview.appspot.com/13988043
2013-09-26 22:33:27 +02:00
David du Colombier
f92e70dc11 fossil: create directory
R=rsc
https://codereview.appspot.com/13984043
2013-09-26 22:32:37 +02:00
David du Colombier
68beda2144 fossil: import conf.rc
R=rsc
https://codereview.appspot.com/13983043
2013-09-26 22:31:57 +02:00
David du Colombier
3fcc209df9 fossil: cast Qid.vers, Dir.mode and Qid.mtime to u32int (thanks Tim Kack)
R=rsc
https://codereview.appspot.com/13981043
2013-09-26 22:31:11 +02:00
David du Colombier
3c612e13a1 fossil: fix various warnings
R=rsc
https://codereview.appspot.com/13980043
2013-09-26 22:30:24 +02:00
David du Colombier
b32de4ae73 fossil: required p9p changes
R=rsc
https://codereview.appspot.com/13352057
2013-09-26 20:12:45 +02:00
David du Colombier
4b57665805 fossil: move from liboventi to libthread and libventi
R=rsc
https://codereview.appspot.com/13504049
2013-09-23 23:16:25 +02:00
David du Colombier
6f4d00ee45 fossil: import from plan 9
R=rsc
https://codereview.appspot.com/7988047
2013-09-23 23:00:39 +02:00
Marius Eriksen
fea86f0639 acme: execute commands with / using shell
This allows commands in bin subdirectories.

R=rsc
CC=plan9port.codebot
https://codereview.appspot.com/13254044
2013-09-06 16:23:49 -04:00
Akshat Kumar
7603066e73 acme Mail: add Search command
Introduces the Search command for mailboxes.
Arguments passed are treated as one space-
separated string, passed on to mailfs' IMAP
search interface.

R=rsc, david.ducolombier
CC=plan9port.codebot
https://codereview.appspot.com/13238044
2013-09-06 16:19:57 -04:00
Akshat Kumar
951fef52c9 mailfs: allow spaces in box name
Mail services (such as Google Mail) will often have
directories with names that contain spaces. Acme
does not support spaces in window names. So, replace
spaces in mail directory names with the Unicode
character for visible space.

The code is a bit of an over-approximation and
generally non-optimal.

R=rsc, david.ducolombier, 0intro
CC=plan9port.codebot
https://codereview.appspot.com/13010048
2013-09-06 16:10:26 -04:00
Akshat Kumar
6541f1798b mailfs: support for UTF-8 searches
UTF-8 searches with the SEARCH command must
be conducted in two steps: the first sends
the SEARCH command with the length of the
UTF-8 encoded string and the second sends
the literal search term. The searches need
to not be quoted.

R=rsc, david.ducolombier, rsc, 0intro
CC=plan9port.codebot
https://codereview.appspot.com/13244043
2013-09-06 16:09:29 -04:00
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