Re: [hackers] [ubase] Set TERM to linux if needed for su and login || sin

2014-06-03 Thread Roberto E. Vargas Caballero
> Set TERM to linux if needed for su and login I think this is incorrect. If you don't have a value of TERM, then you should don't put anything, or put dumb, but why linux?, you expect login will be executed only in virtual terminals?. Regards, -- Roberto E. Vargas Caballero

Re: [hackers] [ubase] Set TERM to linux if needed for su and login || sin

2014-06-03 Thread Roberto E. Vargas Caballero
handle the minimal set of features, the features of a dumb terminal. Regards, -- Roberto E. Vargas Caballero

Re: [hackers] [ubase] Set TERM to linux if needed for su and login || sin

2014-06-03 Thread Roberto E. Vargas Caballero
e HOME or SHELL, but in the case of TERM, you only can take the correct value from the environment of the parent. I don't know what says POSIX about this issue, but maybe should be interesting take a look on it. -- Roberto E. Vargas Caballero

Re: [hackers] [ubase] Set TERM to linux if needed for su and login || sin

2014-06-03 Thread Roberto E. Vargas Caballero
> > Does it seem reasonable? > > Yup. Indeed -- Roberto E. Vargas Caballero

Re: [hackers] [quark] Rectify error-handling || FRIGN

2014-08-11 Thread Roberto E. Vargas Caballero
Hi, Only a small question, > + logerrmsg("errorsocket: %s > ", strerror(errno)); Why do you use a phisical tab instead of \t? And one no related question, are you going to add support for inetd? Regards, -- Roberto E. Vargas Caballero

Re: [hackers] [quark] Rectify error-handling || FRIGN

2014-08-11 Thread Roberto E. Vargas Caballero
d and calls directly the code of tcpd. I think this last way is not very Unix alike when you can use tcpd in any program only using inetd. Regards, -- Roberto E. Vargas Caballero

Re: [hackers] [quark] Rectify error-handling || FRIGN

2014-08-11 Thread Roberto E. Vargas Caballero
st an > insult against the UNIX-philosophy. Can you explain this feeling?. Maybe I am wrong, but I think Unix authors didn't share your opinion because listen(8) of plan9 is the same idea that inetd (but better done because listen doesn't need to parse any configuration file). Reg

Re: [hackers] [quark] Rectify error-handling || FRIGN

2014-08-12 Thread Roberto E. Vargas Caballero
for his goals. -- Roberto E. Vargas Caballero [1] http://inetdxtra.sourceforge.net/

Re: [hackers] [ubase] Add lastlog(8) || Roberto E. Vargas Caballero

2014-08-18 Thread Roberto E. Vargas Caballero
if ((p = strchr(line, ':')) == NULL) { > + fputs("incorrect password file", stderr); > + exit(-1); > + } > + *p = ' ... -- Roberto E. Vargas Caballero

Re: [hackers] [st] Add missed names of charset sequences || Roberto E. Vargas Caballero

2014-09-26 Thread Roberto E. Vargas Caballero
This is the first patch serie in order to change the internal codification. I have pushed them in a new branch called wchar. I don't know why the hook has sent a different commit here. The head of wchar branch is e8f1308. Regards, -- Roberto E. Vargas Caballero

Re: [hackers] [st] Add missed names of charset sequences || Roberto E. Vargas Caballero

2014-09-27 Thread Roberto E. Vargas Caballero
tohackers `git rev-list $newrev` ;; commit) tohackers `git rev-list $oldrev..$newrev` ;; .) ;; esac And other point, how is it possible that ed, the standard editor!!!, is not installed in a suckless machine?!?!?!!! Regards, -- Roberto E. Vargas Caballero

Re: [hackers] [sbase] Stop using EXIT_{SUCCESS,FAILURE} || sin

2014-10-03 Thread Roberto E. Vargas Caballero
Hi, I don't have any problem with the patch, but I don't understand why EXIT_{SUCCESS,FAILURE} is a problem. Thanks, -- Roberto E. Vargas Caballero

Re: [hackers] [sbase] tput should be in ubase || sin

2015-02-25 Thread Roberto E. Vargas Caballero
> tabs > -tput > > The following programs have been imported from OpenBSD and need > replacing or cleaning up: The same applies to tabs. It needs terminfo. Regards,

Re: [hackers] [sbase] Audit printenv(1) || FRIGN

2015-02-28 Thread Roberto E. Vargas Caballero
> On Sat, 28 Feb 2015 13:25:09 -0800 > Evan Gates wrote: > >> The arg loops can simply be for (; *argv; argv++) as the standard >> guarantees argv[argc] is NULL. > > Hey Evan, > > I discussed this with stateless and we came to the conclusion that > the argc-approach is more idiomatic. In this

Re: [hackers] [sbase] Rewrite foldline() in fold(1) || FRIGN

2015-03-17 Thread Roberto E. Vargas Caballero
Hi, > + for (p = str, col = 0; *p && *p != '\n'; p++) { > + if (!UTF8_POINT(*p) && !bflag) > + continue; > + if (col >= width) { > + off = (sflag && spacesect) ? spacesect - str : p - str; > + if (fwrite(str,

Re: [hackers] [sbase] Rewrite foldline() in fold(1) || FRIGN

2015-03-17 Thread Roberto E. Vargas Caballero
> If fwrite() fails with a short element count, will ferror() always be > on true? I am not sure we can rely on this. > > And also if fwrite() fails is it guaranteed that it will continue to > fail on all future calls? Yes, it is. If an error is produced in a stream, the value of error associat

Re: [hackers] [st] Remove strsep() call || Roberto E. Vargas Caballero

2015-03-20 Thread Roberto E. Vargas Caballero
first your loop is wrong. See what happens with the string ";", how many fields do you have there? 2, your code will return only 1. Second, to use directly the pointer or a variable is only a style question, and don't modify the simplicity of the loop. Regards,

Re: [hackers] [smdev] config.mk: default CC = cc || Hiltjo Posthuma

2015-04-14 Thread Roberto E. Vargas Caballero
> -#CC = musl-gcc > +CC = cc cc is the default value of CC, so you don't get anything new with this patch, and you create some problems with: CC=tcc make (of course you can use make -e, but I don't see the point) Regards,

Re: [hackers] [smdev] config.mk: default CC = cc || Hiltjo Posthuma

2015-04-14 Thread Roberto E. Vargas Caballero
> It is just an annoyance on systems where c99 doesn't exist. This is more > common than your example. Uhmmm, you are right, CC by default is c99 in POSIX. Regards,

Re: [hackers] st and combining characters

2015-06-15 Thread Roberto E. Vargas Caballero
Hi, I like the idea, but I think the patch needs some evolution. A patch of 500 lines is usually hard of reading, and in in this case the change is not trivial. On Wed, Jun 10, 2015 at 11:39:25PM +0200, Joakim Sindholt wrote: > glyph now holds a union of two combining characters and a poi

Re: [hackers] [sbase] [PATCH 2/3] find: Fix flushing input buffer with -ok

2015-06-16 Thread Roberto E. Vargas Caballero
On Mon, Jun 15, 2015 at 03:27:37PM -0400, Wolfgang Corcoran-Mathe wrote: > The original flush-stdin loop (with fgets()) hung until the user > entered some extraneous characters for it to kill. I don't know if it is related or not, but I'm having a similar problem with glibc. See this code:

Re: [hackers] [sbase][patch] find: empty line means no for -ok

2015-06-18 Thread Roberto E. Vargas Caballero
Hi, > Yes I most certainly did, this is what I get for submitting patches > without testing. The shame. New patch attached, also protects against > the glibc bug causing fgetc to hang after EOF was received. And what about if we send a patch to glibc instead? Regards,

Re: [hackers] [st] [patch] use goto in xloadfonts

2015-06-22 Thread Roberto E. Vargas Caballero
Hi, On Sat, Jun 20, 2015 at 01:32:45AM -0400, Michael Reed wrote: > > You just made the programmflow harder to grasp and removed the possibility > > to differentiate between the errors in the future. Also the patch adds 4 > > SLoC without achieving anything. > > I agree it's harder to grasp, but

[hackers] St style changes

2015-07-10 Thread Roberto E. Vargas Caballero
Hi, We are doing deep changes of style in st, and it means the style will not be ready until 2 or three weeks, so if you have to update some of your patches in the wiki, then it is better wait a bit (mainly because in other case you will have to update your patch several times). Thank yo

Re: [hackers] [patch][scc] fix parsing end of comment

2015-07-15 Thread Roberto E. Vargas Caballero
Hi, On Thu, Jul 16, 2015 at 12:19:45AM +0100, Dimitris Papastamos wrote: > > diff --git a/cc1/lex.c b/cc1/lex.c > > index c35e401..111c6f8 100644 > > --- a/cc1/lex.c > > +++ b/cc1/lex.c > > @@ -184,8 +184,8 @@ comment(char type) > > { > > if (type == '*') { > > while (!eof) { > >

[hackers] [st][PATCH] Add total compability to the Makefiles

2015-07-15 Thread Roberto E. Vargas Caballero
With .POSIX target we get that the user without environment will execute c99. If the user has no c99, then he can source env.sh or execute build.sh. --- Makefile | 2 ++ build.sh | 8 +--- cc1/Makefile | 3 ++- cc2/Makefile | 2 ++ env.sh | 23 +++ lib/Mak

Re: [hackers] [scc][PATCH] Add total compability to the Makefiles

2015-07-16 Thread Roberto E. Vargas Caballero
On Thu, Jul 16, 2015 at 08:41:31AM +0100, Nick wrote: > The comment line for this is wrong; it's definitely not for st. Did > this come from a commit hook? If so, it needs to be fixed. Ups, you are rigth. This patch is for scc, and it is a proposal, but like almost all the patches I send are for

Re: [hackers] [st] Patch to workaround missing st terminfo on remote SSH.

2015-08-12 Thread Roberto E. Vargas Caballero
On Wed, Aug 12, 2015 at 07:07:15PM +0200, Christoph Lohmann wrote: > It looks like you are redefining the value of ?term? and ?xterm?256col? > or? on systems that have st.info installed. This will create incompati? > bilities for such systems when xterm is used. ?xterm? and ?st? are not > compl

Re: [hackers] [st] Patch to workaround missing st terminfo on remote SSH.

2015-08-13 Thread Roberto E. Vargas Caballero
On Thu, Aug 13, 2015 at 12:17:35PM +0100, Nick wrote: > Quoth Roberto E. Vargas Caballero: > > I think a better aproach is to define an alias like this: > > > > alias ssh=TERM='TERM=xterm ssh' > > Syntax like that is one reason that I prefer one or two line s

[hackers] [st][PATCH] Do not mark as invalid UTF8 control codes

2015-08-17 Thread Roberto E. Vargas Caballero
wcwidth() returns -1 in all the non visible characters, but it doesn't mind that they are incorrect. It only means that they are not printable. --- st.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/st.c b/st.c index 1df4fde..35a840b 100644 --- a/st.c +++ b/st.c @@ -2895,

Re: [hackers] [st] startup options

2015-11-25 Thread Roberto E. Vargas Caballero
> Mainly I want scroll when compiling. It print a lot of information and > warnings. And I want to read them clearly without interrupting my > compilation. Other than that I don't use scrolling much. > > ofcourse, i can redirect std err to a log file and see it. But when I run > "make" I need to r

Re: [hackers] [scc] Fix character sequences || Roberto E. Vargas Caballero

2015-11-25 Thread Roberto E. Vargas Caballero
On Tue, Nov 24, 2015 at 09:24:59PM +0100, pancake wrote: > Why not return c = 'x'; ? > Good point!. In fact, in a previous version, it was written in this way. Can you send a patch with it? Regards,

Re: [hackers] [scc] Fix character sequences || Roberto E. Vargas Caballero

2015-11-27 Thread Roberto E. Vargas Caballero
On Wed, Nov 25, 2015 at 03:04:22AM -0800, Robert Ransom wrote: > On 11/24/15, g...@suckless.org wrote: > > commit 1aa2143073c30f374c33e0288135dc3e04494588 > > Author: Roberto E. Vargas Caballero > > AuthorDate: Tue Nov 24 20:29:45 2015 +0100 > > Commit:

Re: [hackers] [dmenu][RFC][PATCH 0/4] Using sort and simple C program to get dmenu history functionality

2015-11-30 Thread Roberto E. Vargas Caballero
On Mon, Nov 30, 2015 at 06:51:02PM +0100, Hiltjo Posthuma wrote: > Something like (quick hack): > > cat historyfile | awk '//{x[$0]++; } END { for (k in x) { print x[k] " >" k; }}' | sort -k 1rn,2 | cut -f 2- | dmenu >> historyfile > Avoid the death cat!!!. Use something like: awk '{x[$0]++

Re: [hackers] [dmenu][RFC][PATCH] History functionality

2015-12-09 Thread Roberto E. Vargas Caballero
On Wed, Dec 09, 2015 at 10:31:09AM +0100, Silvan Jegen wrote: > I realized that I am not dealing with the case that the history file > does not exist already. I added a simple check for that (although I > was considering just putting in a comment saying that it has to). > > +if [ ! -e $historyfil

[hackers] [sbase][PATCH] Check if PRIO_MIN and PRIO_MAX are defined

2015-12-15 Thread Roberto E. Vargas Caballero
The majority of the systems define PRIO_MAX and PRIO_MIN, but there is an obscure system, whose name I am not going to tell, where they were not defined. --- nice.c | 8 renice.c | 9 + 2 files changed, 17 insertions(+) diff --git a/nice.c b/nice.c index 3b9b9fb..d036e26 100644

Re: [hackers][sbase][PATCH] Activate the "else if" branch

2015-12-16 Thread Roberto E. Vargas Caballero
On Tue, Dec 15, 2015 at 07:54:28PM +0100, Silvan Jegen wrote: > We checked the same condition in the "if" branch so it was never true > in the "else if" one. Removing this condition makes the "else if" > branch viable. I'm sorry, but you are wrong here. Setjmp saves the current state of the progr

Re: [hackers] [sbase] [PATCH] ed: Do not try to read-in a nonexistant file

2015-12-28 Thread Roberto E. Vargas Caballero
On Sat, Dec 26, 2015 at 05:02:39PM -0500, Wolfgang Corcoran-Mathe wrote: > This fixes a segfault caused by running ed with a > nonexistant filename argument, e.g. 'ed not_a_file_yet'. Good catch, but I don't like the solution. I think you are fixing the problem in the incorrect place. The problem

[hackers] [sbase][PATCH 2/3] ed: Don't show '!' in exec with -s

2016-01-01 Thread Roberto E. Vargas Caballero
POSIX indicates that this '!' is a diagnosis that must not be printed when -s is supplied. --- ed.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ed.c b/ed.c index 96cfc3b..5369d60 100644 --- a/ed.c +++ b/ed.c @@ -871,7 +871,8 @@ execsh(void) if (repl)

[hackers] [sbase][PATCH 1/3] ed: Correct error message when open file

2016-01-01 Thread Roberto E. Vargas Caballero
"input/output" error was to general and could create confusion. All the other ed implementations give a "cannot open input file" --- ed.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ed.c b/ed.c index 7e7fbb6..96cfc3b 100644 --- a/ed.c +++ b/ed.c @@ -609,8 +609,8 @@ dore

[hackers] [sbase][PATCH 3/3] ed: Fix error introduced in b19d708

2016-01-01 Thread Roberto E. Vargas Caballero
This patch introduced init() function, which removed the initialization code of savfname in doread, but this is incorrect, because savfname can be initialized with a r command if savfname is empty. --- ed.c | 19 +++ 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/ed

[hackers] [sbase][PATCH] ed: Use TMPDIR to locate the temporal file

2016-01-01 Thread Roberto E. Vargas Caballero
The current behaviour of storing the scratch file in the current directory is a bit painful, because it generates files in all the directories where you execute ed. BSD ed uses TMPDIR for this purpouse, so if the user wants to put the scratch file in other place different of /tmp it only has to set

Re: [hackers] [PATCH] yellow italics everywhere is for colorblind people

2016-01-05 Thread Roberto E. Vargas Caballero
On Tue, Jan 05, 2016 at 05:44:12PM +0800, Pickfire wrote: > On Tue, Jan 05, 2016 at 10:42:52AM +0100, FRIGN wrote: > >>Hi, I use `git send-email`, it won't be mentioned by default. > >>It is for st. As you can see in the patch. > > You can use git send-email --subject-prefix='st][PATCH'

[hackers] [sbase][PATCH] Add egrep and fgrep

2016-01-05 Thread Roberto E. Vargas Caballero
These tools are not part of POSIX, but they were part of the original UNIX and even today they are still wide used. The work done by this tools can be done by grep, so this implementation is only masking the code with different names to get the work done. --- Makefile | 4 +++- grep.c | 5 +

[hackers] [sbase][PATCH] Handle explicitly the case of line 0

2016-01-06 Thread Roberto E. Vargas Caballero
Line 0 is a special line added to allow operations with empty buffers, and we have to ensure that it is not going to match any regular expression. The code was written in a way that this case was handle implicitily, but this solution was working only for the first file loaded in ed, while the secon

[hackers] [sbase][PATCH v2] Handle explicitly the case of line 0

2016-01-06 Thread Roberto E. Vargas Caballero
Line 0 is a special line added to allow operations with empty buffers, and we have to ensure that it is not going to match any regular expression. The code was written in a way that this case was handle implicitily, but this solution was working only for the first file loaded in ed, while the secon

[hackers] [sbase][PATCH v2] Fix pattern substitution

2016-01-07 Thread Roberto E. Vargas Caballero
Ed was falling doing substitution different of the first or all (s//%/, s//%/\1, s//%/g), because it was not adding the matches which were not going to be substituted. --- ed.c | 26 +++--- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/ed.c b/ed.c index 77aad1

[hackers] [sbase][PATCH] Stop matching when lastmatch points to '\n'

2016-01-07 Thread Roberto E. Vargas Caballero
This situation happens with something like s/$/test/, where rm_so == rm_eo == 0. Without this check, ed keeps looping forever. --- ed.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ed.c b/ed.c index 69c7422..9dc6fda 100644 --- a/ed.c +++ b/ed.c @@ -1007,7 +1007,7 @@ subline(

[hackers] [sbase][PATCH] [ed] Do not try to rematch patterns with ^ or $

2016-01-23 Thread Roberto E. Vargas Caballero
It is impossible to rematch a pattern which has one (or both) of these operators, so the simplest solucion is detect them while we are compiling the regular expression and break the match loop after the first iteration. --- ed.c | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-)

Re: [hackers] [sbase] ed: Don't use strlcpy() || Roberto E. Vargas

2017-01-24 Thread Roberto E . Vargas Caballero
> I consider this way of thinking harmful, because it involves You are considered harmful. Regards,

Re: [hackers] [sbase] Revert "ed: remove double free in join()" ||

2017-01-24 Thread Roberto E . Vargas Caballero
Hello Thomas, Sorry for the delay, I had some problems with my mail lately, > The trouble with reverting my commit is that readding the double free > completely > crashes ed if more than one join is performed. I think this patch (which also > reverts > back to having no double free) should han

Re: [hackers] [dwm][PATCH] Fix signal race condition

2017-01-24 Thread Roberto E . Vargas Caballero
> If the signal(2) call within the signal handler fails, die() is called > which in turn is not signal-safe. Therefore, the change to sigaction > makes dwm() more portable among POSIX systems and fixes a signal race > condition. You are right with the original race condition, but I think your solu

Re: [hackers] [farbfeld] Overhaul Build-system || Laslo Hunhold

2017-03-29 Thread Roberto E . Vargas Caballero
>> +png2ff ff2png: LDFLAGS += -lpng >> +jpg2ff ff2jpg: LDFLAGS += -ljpeg >> > > This is invalid and breaks on OpenBSD (and other non-GNU make probably). It is not POSIX, so it is a syntax error for me.

Re: [hackers] [PATCH] Whitelist key event modifiers for shortcuts

2017-04-10 Thread Roberto E . Vargas Caballero
> I'm seeing a weird issue with my xserver where all key press events will > be set with (state & Button1Mask), which ends up breaking all st > keyboard shortcuts. xterm works correctly because it whitelists > modifiers relevant to key press events. Do the same in st. Uhmmm, it seems a bit strang

[hackers] [sbase] Improve doglobal()

2018-03-06 Thread Roberto E. Vargas Caballero
Don't use directly the line numbers and call to getlst() when a line is matched. --- ed.c | 30 ++ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/ed.c b/ed.c index 13c41c6..e6d92e2 100644 --- a/ed.c +++ b/ed.c @@ -1318,7 +1318,7 @@ chkglobal(void) stat

Re: [hackers] [sbase][PATCH v2] Add tests for some utilities

2018-08-02 Thread Roberto E. Vargas Caballero
Hi, On Wed, Aug 01, 2018 at 04:36:35PM +0200, Silvan Jegen wrote: > I definitely think we should have unit tests for sbase (and other > projects?) as soon as possible. What concerns me with your approach is > that we have about 700 lines of C code in testing-common.{c,h} of which > I feel quite a

Re: [hackers] [sbase][PATCH v2] Add tests for some utilities

2018-08-02 Thread Roberto E. Vargas Caballero
Hi, On Wed, Aug 01, 2018 at 09:16:26PM +0200, Silvan Jegen wrote: > > * `echo` is unportable and `printf` should be used instead. > > Didn't know that echo was not portable. Thought it was just a builtin > that should work the same everywhere. It's probably the flags that are > the issue... echo

Re: [hackers] [ii][patch] add support for OpenBSD unveil(2)

2018-09-12 Thread Roberto E. Vargas Caballero
On Tue, Sep 11, 2018 at 08:14:25PM -0300, Gleydson Soares wrote: > the following patch brings support for OpenBSD's unveil(2) mechanism for > ii. Guys, we should stop sending this kind of patches. If we begin to fill all the suckless projects with #ifdef __OpenBSD__, why do we not fill them with #

Re: [hackers] [ii][patch] add support for OpenBSD unveil(2)

2018-09-12 Thread Roberto E. Vargas Caballero
On Wed, Sep 12, 2018 at 10:19:32AM +0200, Laslo Hunhold wrote: > Adding ifdefs of course is a tough decision in any case, though I > always think that suckless tools should be really more tuned towards > OpenBSD as it really is probably the most suckless operating system > around. You are wrong, t

Re: [hackers] [ii][patch] add support for OpenBSD unveil(2)

2018-09-13 Thread Roberto E. Vargas Caballero
Hi, On Wed, Sep 12, 2018 at 08:08:39PM +0200, Laslo Hunhold wrote: > that's your choice as the maintainer and I am not a fanboy. OpenBSD is > objectively more secure and it's mainly due to their approach. Credit > where credit is due. You shpuld read those [1] and [2]. OpenBSD *IS NOT* objectivel

Re: [hackers] [st][patch] Increase the buffer size for escape sequences

2018-09-24 Thread Roberto E. Vargas Caballero
On Sun, Sep 23, 2018 at 03:56:43PM +0200, Ingo Heimbach wrote: > What is incorrect? I would say, why 1048576 and not 1000? or 1?. Is there a specific reason? Roberto

Re: [hackers] [st][patch] Increase the buffer size for escape sequences

2018-09-25 Thread Roberto E. Vargas Caballero
On Mon, Sep 24, 2018 at 05:45:29PM -0700, Eric Pruitt wrote: > I agree that the current buffer is too small. I'm pretty sure I've run > into this problem myself with Vim and Bash, but I hadn't gotten around > to digging into the problem. If we go to increase that size, I would go to use dynamic me

Re: [hackers] Re: [ubase] [PATCH] Include sys/sysmacros.h when major is not defined in sys/types.h

2019-11-10 Thread Roberto E. Vargas Caballero
On Mon, Nov 04, 2019 at 08:01:18AM +0100, Laslo Hunhold wrote: > Dimitris is the current maintainer, so you will have to talk to him, > but I'd say that nothing speaks against you maintaining it. I always > saw sbase and ubase to be siblings, so given you already maintain > sbase, it would make a l

Re: [hackers] st][PATCH - proper escape sequence for CTRL+HOME

2022-03-01 Thread Roberto E. Vargas Caballero
Hi, On Mon, Feb 28, 2022 at 09:27:22PM -0600, Dave Blanchard wrote: > > I have absolutely no idea what the 'appkey' and 'appcursor' fields do, as > there are almost no comments anywhere to be found in the source code, and I > haven't yet reverse engineered the code enough to figure out what th

Re: [hackers] st][PATCH - proper escape sequence for CTRL+HOME

2022-03-01 Thread Roberto e. Vargas Caballero
Hi, On Tue, Mar 01, 2022 at 08:54:15AM -0500, Sebastian LaVine wrote: > > Christ, why do you choose to be so rude to someone you've never talked > to over a simple email? He wants to write comments for a C program. It's > not the end of the world. I personally will be interested in what he > does

Re: [hackers] [st][PATCH] rm unnecessary explicit zeroing

2022-03-17 Thread Roberto E. Vargas Caballero
Hi, On Tue, Mar 15, 2022 at 04:30:52PM +0600, NRK wrote: > +static const char base64_digits[(unsigned char)-1] = { Any reason to write "(unsigned char)-1" instead of writing 256? Regards,

Re: [hackers] [st][PATCH] rm unnecessary explicit zeroing

2022-03-17 Thread Roberto E. Vargas Caballero
Hi, On Fri, Mar 18, 2022 at 03:16:56AM +0600, NRK wrote: > But yes, you're right, you'd need 256 elements to be able to index into > an array as any unsigned char. So maybe it *should* be 256. Uh, I didn't realize about it, I just saw that having 255 entries was wrong ^^!!!. I think the best

Re: [hackers] [st][PATCH v2] code-golfing: cleanup osc color related code

2022-03-21 Thread Roberto E. Vargas Caballero
Hi, A few small nitpicks about formating (fell free to ignore them if you want ;)): On Sun, Mar 20, 2022 at 06:25:40PM +0600, NRK wrote: > @@ -1843,39 +1844,25 @@ csireset(void) > } > > void > -osc4_color_response(int num) > +osc_color_response(int num, int index, int is_osc4) > { > in

Re: [hackers] [st][PATCH] update FAQ regarding meta key

2022-04-12 Thread Roberto E. Vargas Caballero
Hi, > just changing $TERM to "st-meta" doesn't enable the meta key, at least > on vim. searching the mailing list, I learned that `tput smm` was needed > to enable 8bit mode[0]. This topic is a bit more complex. St is doing something a bit weird because we are a utf8 terminal, but we don't enco

Re: [hackers] [sbase] [PATCH] Use ar(1)'s s-flag instead of invoking ranlib(1)

2022-07-22 Thread Roberto E. Vargas Caballero
I disagree with this change. I think it adds nothing and reduce portability of the Makefiles. Regards,

Re: [hackers] [dwm][PATCH] do not call signal-unsafe function inside sighanlder

2022-07-22 Thread Roberto E. Vargas Caballero
Hi, > > Do you have a reference of a description of this behaviour in an other > > system, > > specification or standard? > > > > C89 (7.7.1.1), C99 (7.14.1.1), POSIX 2001 and 2008 all say that "the > equivalent of signal(sig, SIG_DFL)" may be executed prior to executing > the signal handler (b

Re: [hackers] [dwm] Revert "do not call signal-unsafe function inside sighanlder" || Hiltjo Posthuma

2022-07-26 Thread Roberto E. Vargas Caballero
Hi, > > void > > sigchld(int unused) > > { > > + if (signal(SIGCHLD, sigchld) == SIG_ERR) > > + die("can't install SIGCHLD handler:"); > > while (0 < waitpid(-1, NULL, WNOHANG)); > > } > > Calling `die` inside a signhandler is still an issue and can produce > bad behavior (I h

Re: [hackers] [sbase] [PATCH] Use ar(1)'s s-flag instead of invoking ranlib(1)

2022-08-01 Thread Roberto E. Vargas Caballero
Hi, On Sun, Jul 31, 2022 at 01:00:25AM +0200, Laslo Hunhold wrote: > why would it reduce the portability of the Makefiles? It can be > expected that all ar-implementations support the s-flag, and ranlib is > simply legacy. Because then you will support only the last systems. If you keep the ranli

Re: [hackers] [st][PATCH] Add support for DSR response "OK" escape sequence

2023-02-06 Thread Roberto E. Vargas Caballero
Hi, On Mon, Feb 06, 2023 at 08:45:27AM +0200, Santtu Lakkala wrote: > > tsetattr(csiescseq.arg, csiescseq.narg); > > break; > > - case 'n': /* DSR – Device Status Report (cursor position) */ > > - if (csiescseq.arg[0] == 6) { > > + case 'n': /* DSR – Device St

Re: [hackers] [st][PATCH] Add support for DSR response "OK" escape sequence

2023-02-07 Thread Roberto E. Vargas Caballero
On Tue, Feb 07, 2023 at 10:54:57AM -0500, Adam Price wrote: > On Mon, Feb 6, 2023 at 12:06 PM Roberto E. Vargas Caballero > wrote: > > > > Hi, > > > > On Mon, Feb 06, 2023 at 08:45:27AM +0200, Santtu Lakkala wrote: > > > >

Re: [hackers] [sbase][PATCH] tr: fix behavior of cflag when using character classes

2023-09-21 Thread Roberto E. Vargas Caballero
Hi, On Sun, Aug 06, 2023 at 10:50:25PM +0200, noneofyourbusin...@danwin1210.de wrote: > a simple test case: > > printf ab3 | tr -c '[:alpha:]' '\n' Applied.

Re: [hackers] [ubase][PATCH] Explicitly include sys/sysmacros.h for makedev etc

2023-09-21 Thread Roberto E. Vargas Caballero
On Sun, Aug 06, 2023 at 03:03:21PM +0200, Markus Rudy wrote: > This header used to be included by sys/types.h in glibc, and musl > adopted the behaviour. However, this dependency was never desired, so > glibc deprecated it in 2016 and finally removed it in 2019, and so Applied.

Re: [hackers] [sbase][PATCH] xargs: implement -I flag

2023-09-22 Thread Roberto E. Vargas Caballero
Hi, On Sun, Jul 30, 2023 at 10:15:49AM +0300, sewn wrote: > From 9f4be567ff25fee986976c6afa193223496013a6 Mon Sep 17 00:00:00 2001 > From: sewn > Date: Fri, 28 Jul 2023 18:58:37 +0300 > Subject: [PATCH] xargs: add replace string flag (-I) I have applied the patch with some small modifications th

Re: [hackers] [sbase][PATCH] Ensure commands are followed by a blank

2023-09-26 Thread Roberto E. Vargas Caballero
Applied.

Re: [hackers] [PATCH] make: fix rogue parameter in install target

2023-11-14 Thread Roberto E. Vargas Caballero
Applied, thanks.

Re: [hackers] [PATCH] scripts: Force file copying on install

2023-11-14 Thread Roberto E. Vargas Caballero
Applied, thanks.

Re: [hackers] [PATCH 1/2] scripts: Fix non-portable usage of find -maxdepth

2023-11-14 Thread Roberto E. Vargas Caballero
Applied, thanks.

Re: [hackers] [PATCH 2/2] scripts: Fix non-portable find -perm /mode

2023-11-14 Thread Roberto E. Vargas Caballero
Applied, thanks.

Re: [hackers] [PATCH] find: Make parameter error messages more specific

2023-11-14 Thread Roberto E. Vargas Caballero
Applied, thanks.

Re: [hackers] [sbase] TODO: add replacement bug reported for ed || Hiltjo Posthuma

2023-11-14 Thread Roberto E. Vargas Caballero
Applied, thanks.

Re: [hackers] [sbase][PATCH] ed: Allow newlines in a Substitute Command

2023-11-14 Thread Roberto E. Vargas Caballero
Hi, On Sun, Nov 05, 2023 at 02:38:20PM +0100, Rene Kita wrote: > On Fri, Nov 03, 2023 at 01:32:37PM +0100, Rene Kita wrote: > > borked patch > > Patch is not sufficient, sorry for the noise. I have this problem in my radar. I began to write a solution for it, but I had to switch to implement bc(

Re: [hackers] [sbase][PATCH] ed: Allow newlines in a Substitute Command

2023-12-05 Thread Roberto E. Vargas Caballero
Hi, On Wed, Nov 15, 2023 at 08:56:56AM +0100, Rene Kita wrote: > > I think the way to fix this problem is reading the full command before > > executing it, otherwise there are so many traps. I am going to try to > > fix this in th enext days. > > I had the same idea. Reading the full command will

Re: [hackers] [sbase] sbase-box: Fix segmentation fault when exe without args

2023-12-05 Thread Roberto E. Vargas Caballero
Hi, On Fri, Dec 01, 2023 at 01:33:36PM +0100, Jules Maselbas wrote: > when sbase-box is executed without argument, the check sbase-box > options doesn't verify the argument count leading to a segfault. > > Add a check on the argc before parsing sbase-box options (currently > only `-i`) Applied,

[hackers] ed: Enable multi line commands

2023-12-13 Thread Roberto E. Vargas Caballero
It changes to read full lines before executing commands, escaping newlines when it is needed. It solves 2 different cases: - Substitution commands with newlines in the replace part - Global commands with append or insert commands Still, some additional problems were detected in th

[hackers] [PATCH 1/6] ed: Add optional parameter to string()

2023-12-13 Thread Roberto E. Vargas Caballero
This makes possible to use the function to initialize the string from an existing char array. --- ed.c | 30 +- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/ed.c b/ed.c index b430e74..13e956a 100644 --- a/ed.c +++ b/ed.c @@ -122,12 +122,24 @@ prevln(in

[hackers] [PATCH 2/6] ed: Add getinput() and setinput()

2023-12-13 Thread Roberto E. Vargas Caballero
These functions allow to read from stdin the full next line or seting as input a character array. These functions avoid all the complexity about repeat commands that is very fragile and depends on having multiple global variables with weak relation between them. --- ed.c | 171

[hackers] [PATCH 3/6] ed: Read from input in append()

2023-12-13 Thread Roberto E. Vargas Caballero
This enables using a and i commands in a global command because the input is not anymore taken from stdin. --- ed.c | 30 ++ 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/ed.c b/ed.c index 7881fba..ad6c81a 100644 --- a/ed.c +++ b/ed.c @@ -686,6 +686,15

[hackers] [PATCH 4/6] ed: Avoid dangling pointer in getrhs()

2023-12-13 Thread Roberto E. Vargas Caballero
If the string r.str is freed but error() is called then next call will see a pointer that maybe it will try to free because the call to error unwind the frame stack. --- ed.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ed.c b/ed.c index ad6c81a..16fbe04 100644 --- a/ed.c ++

[hackers] [PATCH 5/6] ed: Improve execsh

2023-12-13 Thread Roberto E. Vargas Caballero
--- ed.c | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/ed.c b/ed.c index 16fbe04..60673a2 100644 --- a/ed.c +++ b/ed.c @@ -1061,13 +1061,21 @@ execsh(void) } while ((c = input()) != '\0') { - if (c == '%' && (cmd.siz == 0 || cmd.s

[hackers] [PATCH 6/6] ed: Update TODO

2023-12-13 Thread Roberto E. Vargas Caballero
Remove the cases are tested to work correctly now. --- TODO | 16 1 file changed, 16 deletions(-) diff --git a/TODO b/TODO index a78cf8b..000fd06 100644 --- a/TODO +++ b/TODO @@ -28,10 +28,6 @@ Bugs ed -- -* Multi-line commands don't work in global commands: -g/^line/a \

Re: [hackers] [PATCH 1/6] ed: Add optional parameter to string()

2023-12-28 Thread Roberto E. Vargas Caballero
Hi, On Sun, Dec 24, 2023 at 11:46:26AM +0100, Rene Kita wrote: > Nit as it's more a matter of style: I'd prefer to have one function to > create a String and another function to create a String from a char > array. This would make a cleaner interface and avoids passing and > dealing with NULL all

Re: [hackers] [PATCH 1/6] ed: Add optional parameter to string()

2023-12-28 Thread Roberto E. Vargas Caballero
Hi, On Tue, Dec 26, 2023 at 03:40:36PM +0100, Страхиња Радић wrote: > On 23/12/24 11:46AM, Rene Kita wrote: > > > + if (!from) { > > > + len = 0; > > > + t = NULL; > > > + } else { > > This seems redundant. Normally, NULL shouldn't be passed, and even if it is, > it > is the res

Re: [hackers] ed: Enable multi line commands

2023-12-28 Thread Roberto E. Vargas Caballero
Hi, On Sun, Dec 24, 2023 at 12:07:44PM +0100, Rene Kita wrote: > On Wed, Dec 13, 2023 at 12:55:26PM +0100, Roberto E. Vargas Caballero wrote: > > It changes to read full lines before executing commands, escaping > > newlines when it is needed. It solves 2

[hackers] [PATCH 1/6] ed: Fix makeline

2023-12-28 Thread Roberto E. Vargas Caballero
Strings without newlines created problems in the function and the global field was not updated, making that new lines added were marked as global being processed in the current global command. --- ed.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ed.c b/ed.c index a8bc7

[hackers] [PATCH 0/6] Fix global commands and signal improvements

2023-12-28 Thread Roberto E. Vargas Caballero
This patch serie fixes several problems related to how global commands are managed, fixing G and V commands, and it also adds several small improvements in how signals are handled. Roberto E. Vargas Caballero (6): ed: Fix makeline ed: Remove nothing comments ed: Fix G and V commands ed

  1   2   >