Re: [hackers] [st][PATCH]] Fixed osc color reset without parameter->resets all colors

2023-02-05 Thread Wim Stockman
Ok, Thanks for the info.
I found out what went wrong with the indentation.
I use VIM so I have a visual on the tabs and spaces.
Thanks for teh tip , next time will be a perfect patch :-).
See ya.
Wim Stockman

On Sun, Feb 05, 2023 at 11:35:25PM +0600, NRK wrote:
> On Sun, Feb 05, 2023 at 02:02:47PM +0100, thinkerwim wrote:
> > just a question for next time. What did you mean by white space garbled..
> 
> ST (and most other suckless code) uses TABs for indentation. A common
> mistake is that people end up using spaces instead of TABs (and cannot
> tell the difference because their editor isn't configured to distinguish
> TABs vs spaces).
> 
> But the patch you sent didn't contain _any_ indentation at all. Which is
> rather weird.
> 
> - NRK
> 



Re: [hackers] [st][PATCH]] Fixed osc color reset without parameter->resets all colors

2023-02-05 Thread NRK
On Sun, Feb 05, 2023 at 02:02:47PM +0100, thinkerwim wrote:
> just a question for next time. What did you mean by white space garbled..

ST (and most other suckless code) uses TABs for indentation. A common
mistake is that people end up using spaces instead of TABs (and cannot
tell the difference because their editor isn't configured to distinguish
TABs vs spaces).

But the patch you sent didn't contain _any_ indentation at all. Which is
rather weird.

- NRK



Re: [hackers] [st][PATCH]] Fixed osc color reset without parameter->resets all colors

2023-02-05 Thread thinkerwim
Hi, thanks for the feedback.
was my first patch for suckless. I'll add more detail explanation next time. 
just a question for next time. What did you mean by white space garbled.. I did 
sent it from my OpenBSD server but that shouldn't affect it.
have a nice weekend.
Wim Stockman

Hiltjo Posthuma  schreef op 5 februari 2023 13:35:00 
CET:
>On Sat, Feb 04, 2023 at 12:15:29PM +0100, wim wrote:
>> ---
>> st.c | 8 +---
>> 1 file changed, 5 insertions(+), 3 deletions(-)
>> 
>> diff --git a/st.c b/st.c
>> index 62def59..6b9abc0 100644
>> --- a/st.c
>> +++ b/st.c
>> @@ -1932,9 +1932,11 @@ strhandle(void)
>> if (p && !strcmp(p, "?")) {
>> osc_color_response(j, 0, 1);
>> } else if (xsetcolorname(j, p)) {
>> - if (par == 104 && narg <= 1)
>> - return; /* color reset without parameter */
>> - fprintf(stderr, "erresc: invalid color j=%d, p=%s\n",
>> + if (par == 104 && narg <= 1){/* color reset without parameter */
>> + xloadcols();
>> + return;
>> + }
>> + fprintf(stderr, "erresc: invalid color j=%d, p=%s\n",
>> j, p ? p : "(null)");
>> } else {
>> /*
>> 
>> -- 
>> 2.39.1
>> 
>> 
>
>Hi,
>
>Like I said on IRC (you didn't respond): please be more detailed next time.
>Even though this patch is trivial, some explanation describing the issue and
>some steps to reproduce it makes it much easier to review etc.
>
>Also the patch white-space was garbled,
>
>Otherwise, thanks for the patch.
>
>-- 
>Kind regards,
>Hiltjo
>


Re: [hackers] [st][PATCH]] Fixed osc color reset without parameter->resets all colors

2023-02-05 Thread Hiltjo Posthuma
On Sat, Feb 04, 2023 at 12:15:29PM +0100, wim wrote:
> ---
> st.c | 8 +---
> 1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/st.c b/st.c
> index 62def59..6b9abc0 100644
> --- a/st.c
> +++ b/st.c
> @@ -1932,9 +1932,11 @@ strhandle(void)
> if (p && !strcmp(p, "?")) {
> osc_color_response(j, 0, 1);
> } else if (xsetcolorname(j, p)) {
> - if (par == 104 && narg <= 1)
> - return; /* color reset without parameter */
> - fprintf(stderr, "erresc: invalid color j=%d, p=%s\n",
> + if (par == 104 && narg <= 1){/* color reset without parameter */
> + xloadcols();
> + return;
> + }
> + fprintf(stderr, "erresc: invalid color j=%d, p=%s\n",
> j, p ? p : "(null)");
> } else {
> /*
> 
> -- 
> 2.39.1
> 
> 

Hi,

Like I said on IRC (you didn't respond): please be more detailed next time.
Even though this patch is trivial, some explanation describing the issue and
some steps to reproduce it makes it much easier to review etc.

Also the patch white-space was garbled,

Otherwise, thanks for the patch.

-- 
Kind regards,
Hiltjo



[hackers] [st][PATCH]] Fixed osc color reset without parameter->resets all colors

2023-02-04 Thread wim

---
st.c | 8 +---
1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/st.c b/st.c
index 62def59..6b9abc0 100644
--- a/st.c
+++ b/st.c
@@ -1932,9 +1932,11 @@ strhandle(void)
if (p && !strcmp(p, "?")) {
osc_color_response(j, 0, 1);
} else if (xsetcolorname(j, p)) {
- if (par == 104 && narg <= 1)
- return; /* color reset without parameter */
- fprintf(stderr, "erresc: invalid color j=%d, p=%s\n",
+ if (par == 104 && narg <= 1){/* color reset without parameter */
+ xloadcols();
+ return;
+ }
+ fprintf(stderr, "erresc: invalid color j=%d, p=%s\n",
j, p ? p : "(null)");
} else {
/*

--
2.39.1