grayfox | 29 Aug 21:47 2014
Picon

[OT] Banned from IRC channel?!

Hi,

I just noticed that I'm banned from the #suckless channel after I
changed my shell server and registered my nick. I wonder if this has a
reason and if someone with $rights could unban me, please. Is using
Tor the reason?

Regards,

grayfox

Wolfgang Corcoran-Mathe | 25 Aug 00:25 2014
Picon

[ubase] [PATCH] Remove unnecessary newline output from su

I don't see a reason for this extra newline, but apologies in advance
if I'm just being thick.

--

-- 
Wolfgang Corcoran-Mathe
diff --git a/su.c b/su.c
index fe7e139..71268c1 100644
--- a/su.c
+++ b/su.c
 <at>  <at>  -64,7 +64,7  <at>  <at>  main(int argc, char *argv[])

 	uid = getuid();
 	if (uid) {
-		pass = getpass("Password: "); putchar('\n');
+		pass = getpass("Password: ");
 		if (!pass)
 			eprintf("getpass:");
 		if (pw_check(pw, pass) <= 0)
Roberto E. Vargas Caballero | 23 Aug 17:35 2014

[st] Proposal of changing internal representation

Hi,

I was trying a patch when I realized the problems we have in
st about the internal representation. Take a look to this loop:

        ptr = buf;
        while((charsize = utf8decode(ptr, &unicodep, buflen))) {
                utf8encode(unicodep, s, UTF_SIZ);
                tputc(s, charsize);
                ptr += charsize;
                buflen -= charsize;
        }

For every unicode character we decode it, because we need know how
much input it is used and because we need to know the size of the utf8
string, but after decoding we encode again in utf8 because we need
the utf8 string for tputc.

This part is ugly, but look in the beginning of tputc:

        if(len == 1) {
                width = 1;
                unicodep = ascii = *c;
        } else {
                utf8decode(c, &unicodep, UTF_SIZ);
                width = wcwidth(unicodep);
                control = ISCONTROLC1(unicodep);
                ascii = unicodep;
        }

(Continue reading)

Ben Hendrickson | 22 Aug 18:25 2014

[PATCH] Removing wrapping newlines from selection

When getting selected text, lines that were wrapped because of length
ought not include the wrapping newline in the selection.

This comes up, for example, when copying a bash command that is long
enough to wrap from the console and pasting it back into the console.
The extra newline breaks it.

Similiarly, changes behavior when trimming whitespace from the end of a
physical line to only do so if the line does not wrap. Otherwise we are
trimming whitespace from the middle of a logical line, which may change
its meaning.
---
 st.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/st.c b/st.c
index 497885b..1c34258 100644
--- a/st.c
+++ b/st.c
 <at>  <at>  -662,6 +662,9  <at>  <at>  y2row(int y) {
 static int tlinelen(int y) {
 	int i = term.col;

+	if (term.line[y][i - 1].mode & ATTR_WRAP)
+		return i;
+
 	while (i > 0 && term.line[y][i - 1].c[0] == ' ')
 		--i;

 <at>  <at>  -959,7 +962,7  <at>  <at>  getsel(void) {
(Continue reading)

Ivan Delalande | 20 Aug 21:20 2014
Picon

[st] [PATCH] Change the behavior of word snapping on delimiters

This makes any sequence of identical delimiters be considered a single
word in word-snapping mode. This seems more coherent for this mode and
is similar to what xterm does.
---
 st.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/st.c b/st.c
index 4bc9e70..e929407 100644
--- a/st.c
+++ b/st.c
 <at>  <at>  -708,7 +708,8  <at>  <at>  selected(int x, int y) {
 void
 selsnap(int mode, int *x, int *y, int direction) {
 	int newx, newy, xt, yt;
-	Glyph *gp;
+	bool delim, prevdelim;
+	Glyph *gp, *prevgp;

 	switch(mode) {
 	case SNAP_WORD:
 <at>  <at>  -716,6 +717,8  <at>  <at>  selsnap(int mode, int *x, int *y, int direction) {
 		 * Snap around if the word wraps around at the end or
 		 * beginning of a line.
 		 */
+		prevgp = &term.line[*y][*x];
+		prevdelim = strchr(worddelimiters, prevgp->c[0]) != NULL;
 		for(;;) {
 			newx = *x + direction;
 			newy = *y;
(Continue reading)

Ivan Delalande | 20 Aug 21:14 2014
Picon

[st] [PATCH] Move calls to selsnap into selnormalize

This simplifies getbuttoninfo() and bpress(), and fixes a bug which made word
snapping behave incorrectly when a delimiter was at the beginning or end of
line.
---
 st.c | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/st.c b/st.c
index 009388c..4bc9e70 100644
--- a/st.c
+++ b/st.c
 <at>  <at>  -681,6 +681,9  <at>  <at>  selnormalize(void) {
 	sel.nb.y = MIN(sel.ob.y, sel.oe.y);
 	sel.ne.y = MAX(sel.ob.y, sel.oe.y);

+	selsnap(sel.snap, &sel.nb.x, &sel.nb.y, -1);
+	selsnap(sel.snap, &sel.ne.x, &sel.ne.y, +1);
+
 	/* expand selection over line breaks */
 	if (sel.type == SEL_RECTANGULAR)
 		return;
 <at>  <at>  -776,15 +779,6  <at>  <at>  getbuttoninfo(XEvent *e) {

 	sel.oe.x = x2col(e->xbutton.x);
 	sel.oe.y = y2row(e->xbutton.y);
-
-	if(sel.ob.y < sel.oe.y
-			|| (sel.ob.y == sel.oe.y && sel.ob.x < sel.oe.x)) {
-		selsnap(sel.snap, &sel.ob.x, &sel.ob.y, -1);
-		selsnap(sel.snap, &sel.oe.x, &sel.oe.y, +1);
(Continue reading)

Alexander Huemer | 20 Aug 12:05 2014

[st] [PATCH] Improve readability of enum members

The 'left shift from one' notation of power of two integers is more
expressive than the result.

Signed-off-by: Alexander Huemer <alexander.huemer <at> xx.vu>
---
 st.c | 64 ++++++++++++++++++++++++++++++++--------------------------------
 1 file changed, 32 insertions(+), 32 deletions(-)

diff --git a/st.c b/st.c
index 1c998ec..439adfb 100644
--- a/st.c
+++ b/st.c
 <at>  <at>  -88,17 +88,17  <at>  <at>  char *argv0;

 enum glyph_attribute {
 	ATTR_NULL      = 0,
-	ATTR_BOLD      = 1,
-	ATTR_FAINT     = 2,
-	ATTR_ITALIC    = 4,
-	ATTR_UNDERLINE = 8,
-	ATTR_BLINK     = 16,
-	ATTR_REVERSE   = 32,
-	ATTR_INVISIBLE = 64,
-	ATTR_STRUCK    = 128,
-	ATTR_WRAP      = 256,
-	ATTR_WIDE      = 512,
-	ATTR_WDUMMY    = 1024,
+	ATTR_BOLD      = 1 << 0,
+	ATTR_FAINT     = 1 << 1,
+	ATTR_ITALIC    = 1 << 2,
(Continue reading)

Roberto E. Vargas Caballero | 20 Aug 10:38 2014

[st][PATCH] Add eschandle()

We already have a csihandle() function, where is located code about
CSI sequences, so it is logical do the same with ESC sequences.
This change helps to simplify tcontrol(), which has a complex flow
and should be rewritten.
---
 st.c | 151 ++++++++++++++++++++++++++++++++++++-------------------------------
 1 file changed, 82 insertions(+), 69 deletions(-)

diff --git a/st.c b/st.c
index 009388c..917e83c 100644
--- a/st.c
+++ b/st.c
 <at>  <at>  -356,6 +356,7  <at>  <at>  static void csidump(void);
 static void csihandle(void);
 static void csiparse(void);
 static void csireset(void);
+static int eschandle(uchar ascii);
 static void strdump(void);
 static void strhandle(void);
 static void strparse(void);
 <at>  <at>  -2468,6 +2469,85  <at>  <at>  tdectest(char c) {
 	}
 }

+/*
+ * returns 1 when the sequence is finished and it hasn't to read
+ * more characters for this sequence, otherwise 0
+ */
+int
+eschandle(uchar ascii) {
(Continue reading)

Henrique Lengler | 20 Aug 01:04 2014

sic or ii, whats the main differences?

sic or ii as IRC client? whats the purpouse of each one?

--

-- 
Henrique Lengler	

https://gitorious.org/~henriqueleng

Roberto E. Vargas Caballero | 19 Aug 00:59 2014

[st][PATCH] Improve execsh() and don't allow anonymous shells

This patch improves the shell selection on execsh and forbid
shell with users don't registered in the passwd file.
---
 st.c | 30 +++++++++++++++++-------------
 1 file changed, 17 insertions(+), 13 deletions(-)

diff --git a/st.c b/st.c
index a207730..06761f1 100644
--- a/st.c
+++ b/st.c
 <at>  <at>  -1139,23 +1139,29  <at>  <at>  die(const char *errstr, ...) {

 void
 execsh(void) {
-	char **args;
-	char *envshell = getenv("SHELL");
-	const struct passwd *pass = getpwuid(getuid());
+	char **args, *sh;
+	const struct passwd *pw;
 	char buf[sizeof(long) * 8 + 1];

+	errno = 0;
+	if((pw = getpwuid(getuid())) == NULL) {
+		if(errno)
+			die("getpwuid:%s\n", strerror(errno));
+		else
+			die("who are you?\n");
+	}
 	unsetenv("COLUMNS");
 	unsetenv("LINES");
(Continue reading)

Roberto E. Vargas Caballero | 18 Aug 23:29 2014

[st][PATCH] Fix definition of CONTROLC0

DEL character is not thecnically talking a C0 control character,
although it has some common properties with them, so it is useful
for us consider it as C0. Before this patch DEL (\177), was not
ignored as it ought to be.
---
 st.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/st.c b/st.c
index 8488024..a207730 100644
--- a/st.c
+++ b/st.c
 <at>  <at>  -70,7 +70,7  <at>  <at>  char *argv0;
 #define LEN(a)     (sizeof(a) / sizeof(a)[0])
 #define DEFAULT(a, b)     (a) = (a) ? (a) : (b)
 #define BETWEEN(x, a, b)  ((a) <= (x) && (x) <= (b))
-#define ISCONTROLC0(c) (BETWEEN(c, 0, 0x1f))
+#define ISCONTROLC0(c) (BETWEEN(c, 0, 0x1f) || (c) == '\177')
 #define ISCONTROLC1(c) (BETWEEN(c, 0x80, 0x9f))
 #define ISCONTROL(c) (ISCONTROLC0(c) || ISCONTROLC1(c))
 #define LIMIT(x, a, b)    (x) = (x) < (a) ? (a) : (x) > (b) ? (b) : (x)
--

-- 
1.9.3


Gmane