CVS commit: src/bin/ksh

2019-10-29 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Oct 29 16:19:59 UTC 2019

Modified Files:
src/bin/ksh: misc.c

Log Message:
Avoid arithmetics on strings.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/bin/ksh/misc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/bin/ksh

2019-10-29 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Oct 29 16:19:59 UTC 2019

Modified Files:
src/bin/ksh: misc.c

Log Message:
Avoid arithmetics on strings.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/bin/ksh/misc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/bin/ksh/misc.c
diff -u src/bin/ksh/misc.c:1.24 src/bin/ksh/misc.c:1.25
--- src/bin/ksh/misc.c:1.24	Tue May  8 16:37:59 2018
+++ src/bin/ksh/misc.c	Tue Oct 29 16:19:59 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: misc.c,v 1.24 2018/05/08 16:37:59 kamil Exp $	*/
+/*	$NetBSD: misc.c,v 1.25 2019/10/29 16:19:59 joerg Exp $	*/
 
 /*
  * Miscellaneous functions
@@ -6,7 +6,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: misc.c,v 1.24 2018/05/08 16:37:59 kamil Exp $");
+__RCSID("$NetBSD: misc.c,v 1.25 2019/10/29 16:19:59 joerg Exp $");
 #endif
 
 
@@ -1091,7 +1091,7 @@ print_value_quoted(s)
 	}
 	for (p = s; *p; p++) {
 		if (*p == '\'') {
-			shprintf("%s", "'\\'" + 1 - inquote);
+			shprintf("%s", &"'\\'"[1 - inquote]);
 			inquote = 0;
 		} else {
 			if (!inquote) {



CVS commit: src/bin/ksh

2019-09-26 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Thu Sep 26 11:01:09 UTC 2019

Modified Files:
src/bin/ksh: eval.c lex.c

Log Message:
Fix FALLTHROUGH comments.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/bin/ksh/eval.c
cvs rdiff -u -r1.23 -r1.24 src/bin/ksh/lex.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/bin/ksh/eval.c
diff -u src/bin/ksh/eval.c:1.25 src/bin/ksh/eval.c:1.26
--- src/bin/ksh/eval.c:1.25	Tue Jun 12 14:13:55 2018
+++ src/bin/ksh/eval.c	Thu Sep 26 11:01:09 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: eval.c,v 1.25 2018/06/12 14:13:55 kamil Exp $	*/
+/*	$NetBSD: eval.c,v 1.26 2019/09/26 11:01:09 mlelstv Exp $	*/
 
 /*
  * Expansion - quoting, separation, substitution, globbing
@@ -6,7 +6,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: eval.c,v 1.25 2018/06/12 14:13:55 kamil Exp $");
+__RCSID("$NetBSD: eval.c,v 1.26 2019/09/26 11:01:09 mlelstv Exp $");
 #endif
 
 #include 
@@ -493,6 +493,7 @@ expand(cp, wp, f)
 		  case XARGSEP:
 			type = XARG;
 			quote = 1;
+			/* FALLTHROUGH */
 		  case XARG:
 			if ((c = *x.str++) == '\0') {
 /* force null words to be created so

Index: src/bin/ksh/lex.c
diff -u src/bin/ksh/lex.c:1.23 src/bin/ksh/lex.c:1.24
--- src/bin/ksh/lex.c:1.23	Tue May  8 16:37:59 2018
+++ src/bin/ksh/lex.c	Thu Sep 26 11:01:09 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: lex.c,v 1.23 2018/05/08 16:37:59 kamil Exp $	*/
+/*	$NetBSD: lex.c,v 1.24 2019/09/26 11:01:09 mlelstv Exp $	*/
 
 /*
  * lexical analysis and source input
@@ -6,7 +6,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: lex.c,v 1.23 2018/05/08 16:37:59 kamil Exp $");
+__RCSID("$NetBSD: lex.c,v 1.24 2019/09/26 11:01:09 mlelstv Exp $");
 #endif
 
 
@@ -254,7 +254,7 @@ yylex(cf)
 		*wp++ = QCHAR, *wp++ = c;
 		break;
 	}
-	/* FALLTROUGH */
+	/* FALLTHROUGH */
   default:
 	Xcheck(ws, wp);
 	if (c) { /* trailing \ is lost */



CVS commit: src/bin/ksh

2019-09-26 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Thu Sep 26 11:01:09 UTC 2019

Modified Files:
src/bin/ksh: eval.c lex.c

Log Message:
Fix FALLTHROUGH comments.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/bin/ksh/eval.c
cvs rdiff -u -r1.23 -r1.24 src/bin/ksh/lex.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



Re: CVS commit: src/bin/ksh

2018-06-12 Thread Valery Ushakov
On Tue, Jun 12, 2018 at 14:13:55 +, Kamil Rytarowski wrote:

> UBSan can detect that during switching a login to root there is unportable
> left shift operation:
> 
> $ su -
> Password:
> /public/src.git/bin/ksh/eval.c:598:13: runtime error: left shift of 
> 1073741824 by 1 places cannot be represented in type 'int'
> #

Is this, seriously, how you reproduce it?  It doesn't trigger on just
running ksh?  In which case what is the real problem here - it must be
triggered by some .profile code, which your "reproducer" doesn't
provide.

-uwe


Re: CVS commit: src/bin/ksh

2017-06-22 Thread Kamil Rytarowski
On 23.06.2017 02:12, matthew green wrote:
> "Kamil Rytarowski" writes:
>> Module Name: src
>> Committed By:kamil
>> Date:Thu Jun 22 13:32:04 UTC 2017
>>
>> Modified Files:
>>  src/bin/ksh: c_ksh.c edit.c path.c sh.h
>>
>> Log Message:
>> Remove ancient cygwin support in ksh(1)
>>
>> OK by 
> 
> i thought ksh was upstream owned code, so changes like this
> seem to be out of place in netbsd tree.
> 
> why are you doing all this?
> 
> 
> .mrg
> 

I haven't found active upstream development since around 1999; I have
local patches and I took maintainership. This is what happened in other
BSDs.

I got some old patches and I will try to upstream them after removing
K code. This will also help to address some local bugs that affect my
shell usage.

The domain for multiplatform legacy Unices is covered by MKSH (developed
against gcc1, gcc2). So no need to compete with them for this niche.



signature.asc
Description: OpenPGP digital signature


re: CVS commit: src/bin/ksh

2017-06-22 Thread matthew green
"Kamil Rytarowski" writes:
> Module Name:  src
> Committed By: kamil
> Date: Thu Jun 22 13:32:04 UTC 2017
> 
> Modified Files:
>   src/bin/ksh: c_ksh.c edit.c path.c sh.h
> 
> Log Message:
> Remove ancient cygwin support in ksh(1)
> 
> OK by 

i thought ksh was upstream owned code, so changes like this
seem to be out of place in netbsd tree.

why are you doing all this?


.mrg.