Re: [dev] [st] crash on font resize (patch inside)

2015-02-15 Thread Nils Reuße
On 14.02.2015 22:55, Nils Reuße wrote: hi folks, i found a bug in st (latest git): if you keep downsizing your fontsize until either xw.ch or xw.cw gets 0, st crashes, because there is an unchecked division in cresize. my patch fixes the problem, but i haven't checked for a better solution. ni

Re: [dev] [st] crash on font resize (patch inside)

2015-02-15 Thread k0ga
> diff --git a/st.c b/st.c > index 1deb7bc..547ddc9 100644 > --- a/st.c > +++ b/st.c > @@ -2992,7 +2992,7 @@ xloadfonts(char *fontstr, double fontsize) { > if(!pattern) > die("st: can't open font %s\n", fontstr); > > - if(fontsize > 0) { > + if(fontsize > 1)

Re: [dev] [st] crash on font resize (patch inside)

2015-02-15 Thread Nils Reuße
On 15.02.2015 11:01, k...@shike2.com wrote: diff --git a/st.c b/st.c index 1deb7bc..547ddc9 100644 --- a/st.c +++ b/st.c @@ -2992,7 +2992,7 @@ xloadfonts(char *fontstr, double fontsize) { if(!pattern) die("st: can't open font %s\n", fontstr); - if(fontsize > 0

Re: [dev] [st] crash on font resize (patch inside)

2015-02-15 Thread Martti Kühne
Hmm. I have two style questions about that patch, or about the lines it was crafted upon. Firstly, I did not know C required backslashed newlines for continuation, but a bit more confusingly, usage() IMHO shouldn't really exit the program with nonzero, especially if there's a non-erroneous way to t

Re: [dev] [st] crash on font resize (patch inside)

2015-02-15 Thread Rian Hunter
Maybe still add an assert() against the divisor != 0 before the code in the other patch. Just so people in the future will know that if it does == 0 there is a logic error elsewhere in the program. > On Feb 15, 2015, at 2:05 AM, Nils Reuße wrote: > >> On 15.02.2015 11:01, k...@shike2.com wrot

[dev] [sbase] [PATCH] uudecode: fix error messages...

2015-02-15 Thread Ralph Eastwood
If the input file has no filename specified, give an error message. Also make sure all error messages have newlines. Thanks Evil_Bob for noticing the acceptance of invalid, null filename case! Cheers, Ralph -- Tai Chi Minh Ralph Eastwood tcmreastw...@gmail.com From 40a23f667c9f914a9b533e5b3b018

[dev] [ls] [PATCH] ls implementation or -R -C -q -u (WIP: please help test)

2015-02-15 Thread Ralph Eastwood
I've made an implementation of recursive output of ls and columns. ls -C is stated in the POSIX standard so I've tried to implement it sucklessly (as opposed to using the cols command). It dynamically resizes based on the contents of each column, which differs from ls | cols output. ls -q replace

[dev] [sbase] [PATCH] ls fallback if ioctl does not work

2015-02-15 Thread Ralph Eastwood
As per discussion on IRC with FRIGN, ioctl is no standard, but it is probably a defacto standard; how else can you determine the terminal width portably? However, this patch adds a fallback in case you can't read the terminal width - this is how cols currently does it. -- Tai Chi Minh Ralph East

Re: [dev] [ls] [PATCH] ls implementation or -R -C -q -u (WIP: please help test)

2015-02-15 Thread Alexandre Niveau
ls -q replaces non printable characters with '?'; I'm not sure how to make files with non-printable characters as yet, touch "$(printf 'foo\nbar')" touch "this $(tput setaf 1) is red" You can also use Control+V to enter the next character literally (tab, CR, backspace, etc.). all I know is

Re: [dev] [ls] [PATCH] ls implementation or -R -C -q -u (WIP: please help test)

2015-02-15 Thread FRIGN
On Sun, 15 Feb 2015 12:56:05 + Ralph Eastwood wrote: Hey Ralph, > ls -q replaces non printable characters with '?'; I'm not sure how to > make files with non-printable characters as yet, all I know is this > code path works with input that does not have non-printable > characters. well, cre

Re: [dev] [ls] [PATCH] ls implementation or -R -C -q -u (WIP: please help test)

2015-02-15 Thread Alexandre Niveau
There's a problem in isprintrune in sbase, it can only return 0 because of the “&& (r < 0xFFF9) && (r > 0xFFFB)” part. When fixing it (and the others problems I mentioned earlier), Ralph's patch works (it needs cleaning though). The only real way to do this is to also look at wide characters.

Re: [dev] [ls] [PATCH] ls implementation or -R -C -q -u (WIP: please help test)

2015-02-15 Thread Ralph Eastwood
On 15 February 2015 at 15:16, Alexandre Niveau wrote: > There's a problem in isprintrune in sbase, it can only return 0 because of > the “&& (r < 0xFFF9) && (r > 0xFFFB)” part. When fixing it (and the others > problems I mentioned earlier), Ralph's patch works (it needs cleaning > though). > Than

Re: [dev] [ls] [PATCH] ls implementation or -R -C -q -u (WIP: please help test)

2015-02-15 Thread FRIGN
On Sun, 15 Feb 2015 16:16:41 +0100 Alexandre Niveau wrote: Hey Alexandre, > There's a problem in isprintrune in sbase, it can only return 0 because > of the “&& (r < 0xFFF9) && (r > 0xFFFB)” part. When fixing it (and the > others problems I mentioned earlier), Ralph's patch works (it needs >

Re: [dev] [ls] [PATCH] ls implementation or -R -C -q -u (WIP: please help test)

2015-02-15 Thread Ralph Eastwood
On 15 February 2015 at 15:32, FRIGN wrote: > thanks for reporting this! > I remember writing this part of mkrunetype.awk at 2am in the morning. > In the end, the most trivial things are wrong. :P > I changed the underlying awk-script as well, so we're good to go now. Revised patchset rebased onto

[dev] [sbase] [PATCH] Updated chown, chgrp symlink dereferenncing -[HLP] patches

2015-02-15 Thread Ralph Eastwood
I've updated the patches for chown and chgrp to reflect the new lchown/lchgrp functions. -- Tai Chi Minh Ralph Eastwood tcmreastw...@gmail.com From d6bab3f610f1626854e4075e38a3635423121c31 Mon Sep 17 00:00:00 2001 From: Tai Chi Minh Ralph Eastwood Date: Mon, 9 Feb 2015 19:53:24 + Subject: [P

Re: [dev] [st] crash on font resize (patch inside)

2015-02-15 Thread k0ga
> Firstly, I did not know C required backslashed newlines for > continuation, It doesn't need it. Backslash escapes newlines, but in this case is not needed because two strings together are joined. They are put only because it's part of the style used by the original author of st. > but a bit mo

Re: [dev] [sbase] [PATCH] ls fallback if ioctl does not work

2015-02-15 Thread k0ga
> As per discussion on IRC with FRIGN, ioctl is no standard, but it is > probably a defacto standard; how else can you determine the terminal > width portably? However, this patch adds a fallback in case you can't > read the terminal width - this is how cols currently does it. You can trust the v

Re: [dev] [st] crash on font resize (patch inside)

2015-02-15 Thread k0ga
> Maybe still add an assert() against the divisor != 0 before the code in the > other patch. > > Just so people in the future will know that if it does == 0 there is a logic > error elsewhere in the program. > I don't like this idea, because it means we have to add an assert before any divisio

Re: [dev] [st] crash on font resize (patch inside)

2015-02-15 Thread Markus Teich
Heyho, k...@shike2.com wrote: > It doesn't need it. Backslash escapes newlines, but in this case is not needed > because two strings together are joined. They are put only because it's part > of the style used by the original author of st. This is very inconsistent, because the first linebreak u

Re: [dev] [st] crash on font resize (patch inside)

2015-02-15 Thread Markus Teich
k...@shike2.com wrote: > I don't like this idea, because it means we have to add an assert before any > division, and before the usage of any * or -> ... Heyho, I agree. Also this does not help at all for distributions which don't build st with debug symbols. Fixing the bug is better than just w

Re: [dev] [st] [PATCH] Let curses do the dirty work for flash

2015-02-15 Thread k0ga
> Use the terminfo delay syntax ($) in our flash capability to avoid > hardcoding a fixed delay in redraw() when called from tsetmode() with > DECSCNM. > We need to turn on the npc capability so that delays are made with > xon/xoff instead of padding characters. I tried long time ago something sim

Re: [dev] [st] [PATCH] Let curses do the dirty work for flash

2015-02-15 Thread k0ga
> By the way, I looked at other term definitions of this capability and I > noticed this interesting difference: > > vt200|vt220, similar for xterm, konsole, etc. > flash=\E[?5h$<200/>\E[?5l > vt330|vt340, vt400, linux-basic… > flash=\E[?5h\E[?5l$<200/> >

Re: [dev] [sbase] [PATCH] ls fallback if ioctl does not work

2015-02-15 Thread FRIGN
On Sun, 15 Feb 2015 17:50:19 +0100 k...@shike2.com wrote: > You can trust the value of COLUMNS. I think this is the correct way > programs must detect the size of the terminal. The stress is _portably_. Quoting ioctl(2) manpage: CONFORMING TO No single standard. Arguments, returns, and s

Re: [dev] [st] crash on font resize (patch inside)

2015-02-15 Thread FRIGN
On Sun, 15 Feb 2015 17:55:47 +0100 Markus Teich wrote: > > This way of writing usage() is common, because it is called when an error in > > arguments is detected or when the user interactively ask for it, and in this > > last case the return value is not important because it is not going to be >

Re: [dev] [st] crash on font resize (patch inside)

2015-02-15 Thread k0ga
Hi, > This is very inconsistent, because the first linebreak uses the backslash and > the second one directly following it does not use it. I think the first one > should be removed. It is true that it is inconsistent (and I think it's my fault). I personally don't like these unneeded \, and I th

Re: [dev] [sbase] [PATCH] ls fallback if ioctl does not work

2015-02-15 Thread Ralph Eastwood
On 15 February 2015 at 16:50, wrote: > You can trust the value of COLUMNS. I think this is the correct way > programs must detect the size of the terminal. Unfortunately, this is the first thing I tried - and I found that the variable isn't actually exported. So short of running export COLUMNS;

[dev] Suckless web rendering engine

2015-02-15 Thread Marc Collin
Are there any plans for this?

Re: [dev] Suckless web rendering engine

2015-02-15 Thread Eric Pruitt
On Sun, Feb 15, 2015 at 04:10:15PM -0200, Marc Collin wrote: > Are there any plans for this? Is such a thing even possible? I can't imagine there being a web rendering engine that this community would consider suckless that would also be useful for day-to-day web browsing. Eric

Re: [dev] Suckless web rendering engine

2015-02-15 Thread Bobby Powers
Marc Collin wrote: > Are there any plans for this? Have you tried Google Chrome?

Re: [dev] Suckless web rendering engine

2015-02-15 Thread Markus Teich
Eric Pruitt wrote: > Is such a thing even possible? I can't imagine there being a web rendering > engine that this community would consider suckless that would also be useful > for day-to-day web browsing. Heyho, imho you can either have a suckless „rendering“ engine aka html2text or just some sc

Re: [dev] Suckless web rendering engine

2015-02-15 Thread FRIGN
On Sun, 15 Feb 2015 10:13:12 -0800 Eric Pruitt wrote: Hey Eric, > Is such a thing even possible? I can't imagine there being a web > rendering engine that this community would consider suckless that would > also be useful for day-to-day web browsing. yes, you are going the right direction. We a

Re: [dev] Suckless web rendering engine

2015-02-15 Thread Marc Weber
http://www.netsurf-browser.org/ could be close. also have a look at: http://de.wikipedia.org/wiki/Servo_(Software) In any case it looks like to be a lot of effort. Marc Weber

Re: [dev] [sbase] [PATCH] ls fallback if ioctl does not work

2015-02-15 Thread k0ga
> The ioctl() can be assumed to be present on all systems, but in case > TIOCGWINSZ doesn't exist, we fall back to the fixed value. This is the > best of both worlds. > I like your solution, but I think COLUMNS should have a bigger priority, because in this case user can define a different value

Re: [dev] [sbase] [PATCH] ls fallback if ioctl does not work

2015-02-15 Thread Dimitris Papastamos
On Sun, Feb 15, 2015 at 07:35:51PM +0100, k...@shike2.com wrote: > > > The ioctl() can be assumed to be present on all systems, but in case > > TIOCGWINSZ doesn't exist, we fall back to the fixed value. This is the > > best of both worlds. > > > > I like your solution, but I think COLUMNS should

Re: [dev] [sbase] [PATCH] ls fallback if ioctl does not work

2015-02-15 Thread FRIGN
On Sun, 15 Feb 2015 19:35:51 +0100 k...@shike2.com wrote: > I like your solution, but I think COLUMNS should have a bigger > priority, because in this case user can define a different value of > the current width. Okay, then do 3 fallbacks ioctl -> getenv -> fixed width -- FRIGN

Re: [dev] [sbase] [PATCH] ls fallback if ioctl does not work

2015-02-15 Thread k0ga
> On Sun, 15 Feb 2015 19:35:51 +0100 > k...@shike2.com wrote: > >> I like your solution, but I think COLUMNS should have a bigger >> priority, because in this case user can define a different value of >> the current width. > > Okay, then do 3 fallbacks > > ioctl -> getenv -> fixed width > Ups,

Re: [dev] Suckless web rendering engine

2015-02-15 Thread Ralph Eastwood
On 15 February 2015 at 18:23, Marc Weber wrote: > http://www.netsurf-browser.org/ could be close. > also have a look at: http://de.wikipedia.org/wiki/Servo_(Software) > In any case it looks like to be a lot of effort. > > Marc Weber > I've glanced at netsurf in passing (source code/design) etc.

Re: [dev] [st] crash on font resize (patch inside)

2015-02-15 Thread Rian Hunter
On Feb 15, 2015, at 8:52 AM, k...@shike2.com wrote: >> Maybe still add an assert() against the divisor != 0 before the code in the >> other patch. >> >> Just so people in the future will know that if it does == 0 there is a logic >> error elsewhere in the program. > > I don't like this idea, b

Re: [dev] Suckless web rendering engine

2015-02-15 Thread Calvin Morrison
check out dillo On 15 February 2015 at 13:52, Ralph Eastwood wrote: > On 15 February 2015 at 18:23, Marc Weber wrote: >> http://www.netsurf-browser.org/ could be close. >> also have a look at: http://de.wikipedia.org/wiki/Servo_(Software) >> In any case it looks like to be a lot of effort. >> >>

Re: [dev] Suckless web rendering engine

2015-02-15 Thread Ralph Eastwood
On 15 February 2015 at 19:02, Calvin Morrison wrote: > check out dillo > > On 15 February 2015 at 13:52, Ralph Eastwood wrote: >> On 15 February 2015 at 18:23, Marc Weber wrote: >>> http://www.netsurf-browser.org/ could be close. >>> also have a look at: http://de.wikipedia.org/wiki/Servo_(Softw

Re: [dev] Suckless web rendering engine

2015-02-15 Thread Marc Collin
NetSurf's parser isn't suckless. Here are some issues with their tokeniser.c - Using switch statement and explicit case numbers to implement the tokeniser FSM instead of simple gotos and implicit position-based FSM. This means it has to go through that switch every time through the main loop, eve

Re: [dev] [sbase] [PATCH] ls fallback if ioctl does not work

2015-02-15 Thread Dimitris Papastamos
On Sun, Feb 15, 2015 at 07:48:58PM +0100, k...@shike2.com wrote: > > On Sun, 15 Feb 2015 19:35:51 +0100 > > k...@shike2.com wrote: > > > >> I like your solution, but I think COLUMNS should have a bigger > >> priority, because in this case user can define a different value of > >> the current width

Re: [dev] Suckless web rendering engine

2015-02-15 Thread Teodoro Santoni
On Sun, Feb 15, 2015 at 04:10:15PM -0200, Marc Collin wrote: > Are there any plans for this? You may try to contribute to Blink and Servo. They may still suck, though. -- Teodoro Santoni

[dev] [dwm] Sporadic freezing

2015-02-15 Thread Eric Pruitt
I've been having sporadic issues with dwm where after interacting with some windows, often after moving or resizing them, dwm (or X11?) stops recognizing input. It doesn't seem that dwm is completely frozen -- my clock, which is updated with watch(1) and xsetroot(1), continues to update as expected

Re: [dev] Suckless web rendering engine

2015-02-15 Thread Dmitrij D. Czarkoff
Marc Weber said: > also have a look at: http://de.wikipedia.org/wiki/Servo_(Software) Servo appears to suck a lot. They appear to focus on improving performance by spawning endless threads (complexity), and they require specific custom version of compiler (quirkiness). -- Dmitrij D. Czarkoff