Re: [dev] [sinit] 0.9 release

2014-04-22 Thread Martti Kühne
On Sat, Apr 19, 2014 at 9:13 AM, Krol, Willem van de <008...@jfc.nl> wrote: > Isn't setpgid(0, 0) after setsid() redundant? > No. [0] setsid() creates a new session. cheers! mar77i [0] http://pubs.opengroup.org/onlinepubs/009695399/functions/setsid.html

Re: [dev] [sinit] 0.9 release

2014-04-22 Thread sin
On Tue, Apr 22, 2014 at 09:09:31AM +0200, Martti Kühne wrote: > On Sat, Apr 19, 2014 at 9:13 AM, Krol, Willem van de <008...@jfc.nl> wrote: > > Isn't setpgid(0, 0) after setsid() redundant? > > > > No. [0] setsid() creates a new session. The issue is related to setsid() - in particular if you use

[dev] [st] [PATCH 3/6] Remove argument names from function prototypes.

2014-04-22 Thread noname
--- st.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/st.c b/st.c index 6da4827..64384cd 100644 --- a/st.c +++ b/st.c @@ -360,7 +360,7 @@ static void strparse(void); static void strreset(void); static int tattrset(int); -static void tprinter(char *s, size_t

[dev] [st] [PATCH 2/6] Style fix in tdumpsel.

2014-04-22 Thread noname
--- st.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/st.c b/st.c index 92fd7da..6da4827 100644 --- a/st.c +++ b/st.c @@ -2256,8 +2256,7 @@ printsel(const Arg *arg) { } void -tdumpsel(void) -{ +tdumpsel(void) { char *ptr; if((ptr = getsel())) { -- 1.

[dev] [st] [PATCH 6/6] Make xrealloc and xstrdup style consistent.

2014-04-22 Thread noname
--- st.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/st.c b/st.c index bb3e687..aba034f 100644 --- a/st.c +++ b/st.c @@ -549,12 +549,10 @@ xrealloc(void *p, size_t len) { char * xstrdup(char *s) { - char *p = strdup(s); - - if (!p) + if((s = strd

[dev] [st] [PATCH 4/6] Use uint and uchar instead of unsigned int and unsigned char.

2014-04-22 Thread noname
--- st.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/st.c b/st.c index 64384cd..b8bf84b 100644 --- a/st.c +++ b/st.c @@ -298,13 +298,13 @@ typedef struct { typedef union { int i; - unsigned int ui; + uint ui; float f; const void

[dev] [st] [PATCH 5/6] Use BETWEEN in tsetchar.

2014-04-22 Thread noname
--- st.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/st.c b/st.c index b8bf84b..bb3e687 100644 --- a/st.c +++ b/st.c @@ -1544,8 +1544,7 @@ tsetchar(char *c, Glyph *attr, int x, int y) { * The table is proudly stolen from rxvt. */ if(attr->mode &

[dev] [st] [PATCH 1/6] Use BETWEEN in tinsertblankline and tdeleteline.

2014-04-22 Thread noname
--- st.c | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/st.c b/st.c index 019f53c..92fd7da 100644 --- a/st.c +++ b/st.c @@ -1628,18 +1628,14 @@ tinsertblank(int n) { void tinsertblankline(int n) { - if(term.c.y < term.top || term.c.y > term.bot) -

[dev] [st] [PATCH] Fix techo handling of control characters.

2014-04-22 Thread noname
Internally st represents characters using "char" type. It is used in CSIEscape.buf, Glyph.c etc. However, char can be either signed or unsigned depends on the architecture. On x86 '\x80' < 0x20 is true, but (uchar)'\x80' < 0x20 is false. tputc explicitly converts character to ascii code:

Re: [dev] [st] [PATCH] Fix techo handling of control characters.

2014-04-22 Thread noname
BTW what do you think about converting st code to store characters in uchar instead of char to avoid these problems in the future and avoid manual conversions? tsetchar should probably be fixed too. c[0] >= 0x41 && c[0] <= 0x7e works, but it is better to change type of `c' to uchar *.

Re: [dev] [st] [patch] misplaced parenthesis in LEN macro

2014-04-22 Thread Martti Kühne
On Sun, Apr 20, 2014 at 9:24 PM, Rob wrote: > Into the bikeshed I go... > > LEN(a + 2) doesn't mean anything anyway, as a's type decays. > > To do it properly there should be some kind of static assert in the > macro that the argument is of array type. But this is a small code base > and you'd exp

Re: [dev] [PATCH] [st 1/3] Use tsetdirt in tscrollup and tscrolldown.

2014-04-22 Thread Roberto E. Vargas Caballero
Hi, I like these patches, and I want to apply them, but there is a small thing that I think should be modified. After the patches tscolldown has: tsetdirt(orig, term.bot-n); tclearregion(0, term.bot-n+1, term.col-1, term.bot); but tscrollup has: tclearregion(0, o

Re: [dev] [st] [PATCH 1/6] Use BETWEEN in tinsertblankline and tdeleteline.

2014-04-22 Thread Roberto E. Vargas Caballero
Hi, I am going to apply the full set of patches. Thanks!! -- Roberto E. Vargas Caballero

Re: [dev] [PATCH] [st 1/3] Use tsetdirt in tscrollup and tscrolldown.

2014-04-22 Thread noname
On Tue, Apr 22, 2014 at 09:34:58PM +0200, Roberto E. Vargas Caballero wrote: > Hi, > > I like these patches, and I want to apply them, but there is a > small thing that I think should be modified. After the patches tscolldown > has: > > tsetdirt(orig, term.bot-n); > tclearregion

Re: [dev] [st] [PATCH] Fix techo handling of control characters.

2014-04-22 Thread Roberto E. Vargas Caballero
> It is used in CSIEscape.buf, Glyph.c etc. > However, char can be either signed or unsigned depends on the > architecture. It depends of the compiler, not of the architecture. Compiler will decide signess of char based in what can be more efficient or what is more logical. > On x86 '\x80' < 0x20

[dev] [st] [PATCH] Fix techo handling of control and multibyte characters.

2014-04-22 Thread noname
techo compares signed char to '\x20'. Any character with code less then '\x20' is treated as control character. This way characters with MSB set to 1 are considered control characters too. Also this patch makes techo display DEL character as ^?. To reprocuce the bug, enable echo mode using print

Re: [dev] lock (1) - where does it go?

2014-04-22 Thread Calvin Morrison
> How are you getting on with this? I am planning to do a bit more polishing > to ubase + add 1-2 tools and then make an initial v0.1 release. Would wouldn't this fit better in sbase?

Re: [dev] lock (1) - where does it go?

2014-04-22 Thread sin
On Tue, Apr 22, 2014 at 05:20:29PM -0400, Calvin Morrison wrote: > > How are you getting on with this? I am planning to do a bit more polishing > > to ubase + add 1-2 tools and then make an initial v0.1 release. Would > > wouldn't this fit better in sbase? depends... a naive implementation can

Re: [dev] lock (1) - where does it go?

2014-04-22 Thread Calvin Morrison
On 22 April 2014 17:24, sin wrote: > On Tue, Apr 22, 2014 at 05:20:29PM -0400, Calvin Morrison wrote: >> > How are you getting on with this? I am planning to do a bit more polishing >> > to ubase + add 1-2 tools and then make an initial v0.1 release. Would >> >> wouldn't this fit better in sbase

Re: [dev] lock (1) - where does it go?

2014-04-22 Thread sin
On Tue, Apr 22, 2014 at 05:34:47PM -0400, Calvin Morrison wrote: > On 22 April 2014 17:24, sin wrote: > > On Tue, Apr 22, 2014 at 05:20:29PM -0400, Calvin Morrison wrote: > >> > How are you getting on with this? I am planning to do a bit more > >> > polishing > >> > to ubase + add 1-2 tools and

[dev] [PATCH] Simplify tdeletechar and tinsertblank and fix memory corruption.

2014-04-22 Thread noname
Current CSI parsing code uses strtol to parse arguments and allows them to be negative. Negative argument is not properly handled in tdeletechar and tinsertblank and results in memory corruption in memmove. Reproduce with printf '\e[-500@' Patch also removes special handling for corner case and s

[dev][sandy][patch] minor typo correction

2014-04-22 Thread joshua
Minor typo correction. diff --git a/TODO b/TODO index 6e01237..535a8e4 100644 --- a/TODO +++ b/TODO @@ -13,7 +13,7 @@ In no particular order, at sandy.c: At config.def.h: - Bindings! - Use local/system script path and all -- Choose color-set for either black of white bg +- Choose color-set for e