svn commit: r197356 - in head: tools/regression/usr.bin/sed usr.bin/sed

2009-09-20 Thread Diomidis Spinellis
Author: dds
Date: Sun Sep 20 14:11:33 2009
New Revision: 197356
URL: http://svn.freebsd.org/changeset/base/197356

Log:
  Allow [ to be used as a delimiter.
  
  Pointed by:   Marius Strobl
  Obtained from:Apple

Modified:
  head/tools/regression/usr.bin/sed/multitest.t
  head/usr.bin/sed/compile.c

Modified: head/tools/regression/usr.bin/sed/multitest.t
==
--- head/tools/regression/usr.bin/sed/multitest.t   Sun Sep 20 13:54:27 
2009(r197355)
+++ head/tools/regression/usr.bin/sed/multitest.t   Sun Sep 20 14:11:33 
2009(r197356)
@@ -432,6 +432,15 @@ u2/g' lines1
# POSIX does not say that this should work,
# but it does for GNU, BSD, and SunOS
mark '8.17' ; $SED -e 's/[/]/Q/' lines1
+
+   COMMENT='[ as an s delimiter and its escapes'
+   mark '8.18' ; $SED -e 's[_[X[' lines1
+   # This is a matter of interpretation
+   # POSIX 1003.1, 2004 says Within the BRE and the replacement,
+   # the BRE delimiter itself can be used as a *literal* character
+   # if it is preceded by a backslash
+   mark '8.19' ; sed 's/l/[/' lines1 | $SED -e 's[\[.[X['
+   mark '8.20' ; sed 's/l/[/' lines1 | $SED -e 's[\[.[X\[['
 }
 
 test_error()

Modified: head/usr.bin/sed/compile.c
==
--- head/usr.bin/sed/compile.c  Sun Sep 20 13:54:27 2009(r197355)
+++ head/usr.bin/sed/compile.c  Sun Sep 20 14:11:33 2009(r197356)
@@ -387,7 +387,7 @@ compile_delimited(char *p, char *d)
errx(1, %lu: %s: newline can not be used as a string 
delimiter,
linenum, fname);
while (*p) {
-   if (*p == '[') {
+   if (*p == '['  *p != c) {
if ((d = compile_ccl(p, d)) == NULL)
errx(1, %lu: %s: unbalanced brackets ([]), 
linenum, fname);
continue;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r197357 - head/tools/regression/usr.bin/sed

2009-09-20 Thread Diomidis Spinellis
Author: dds
Date: Sun Sep 20 14:20:00 2009
New Revision: 197357
URL: http://svn.freebsd.org/changeset/base/197357

Log:
  Describe how other systems treat this case.

Modified:
  head/tools/regression/usr.bin/sed/multitest.t

Modified: head/tools/regression/usr.bin/sed/multitest.t
==
--- head/tools/regression/usr.bin/sed/multitest.t   Sun Sep 20 14:11:33 
2009(r197356)
+++ head/tools/regression/usr.bin/sed/multitest.t   Sun Sep 20 14:20:00 
2009(r197357)
@@ -438,7 +438,11 @@ u2/g' lines1
# This is a matter of interpretation
# POSIX 1003.1, 2004 says Within the BRE and the replacement,
# the BRE delimiter itself can be used as a *literal* character
-   # if it is preceded by a backslash
+   # if it is preceded by a backslash
+   # SunOS 5.1 /usr/bin/sed and Mac OS X follow the literal POSIX
+   # interpretation.
+   # GNU sed version 4.1.5 treats \[ as the beginning of a character
+   # set specification (both with --posix and without).
mark '8.19' ; sed 's/l/[/' lines1 | $SED -e 's[\[.[X['
mark '8.20' ; sed 's/l/[/' lines1 | $SED -e 's[\[.[X\[['
 }
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r197360 - head/tools/regression/usr.bin/sed/regress.multitest.out

2009-09-20 Thread Diomidis Spinellis
Author: dds
Date: Sun Sep 20 15:04:50 2009
New Revision: 197360
URL: http://svn.freebsd.org/changeset/base/197360

Log:
  Add correct test results.

Added:
  head/tools/regression/usr.bin/sed/regress.multitest.out/8.18   (contents, 
props changed)
  head/tools/regression/usr.bin/sed/regress.multitest.out/8.19   (contents, 
props changed)
  head/tools/regression/usr.bin/sed/regress.multitest.out/8.20   (contents, 
props changed)

Added: head/tools/regression/usr.bin/sed/regress.multitest.out/8.18
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/regression/usr.bin/sed/regress.multitest.out/8.18Sun Sep 
20 15:04:50 2009(r197360)
@@ -0,0 +1,14 @@
+l1X1
+l1X2
+l1X3
+l1X4
+l1X5
+l1X6
+l1X7
+l1X8
+l1X9
+l1X10
+l1X11
+l1X12
+l1X13
+l1X14

Added: head/tools/regression/usr.bin/sed/regress.multitest.out/8.19
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/regression/usr.bin/sed/regress.multitest.out/8.19Sun Sep 
20 15:04:50 2009(r197360)
@@ -0,0 +1,14 @@
+X_1
+X_2
+X_3
+X_4
+X_5
+X_6
+X_7
+X_8
+X_9
+X_10
+X_11
+X_12
+X_13
+X_14

Added: head/tools/regression/usr.bin/sed/regress.multitest.out/8.20
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/regression/usr.bin/sed/regress.multitest.out/8.20Sun Sep 
20 15:04:50 2009(r197360)
@@ -0,0 +1,14 @@
+X[_1
+X[_2
+X[_3
+X[_4
+X[_5
+X[_6
+X[_7
+X[_8
+X[_9
+X[_10
+X[_11
+X[_12
+X[_13
+X[_14
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r197361 - in head: tools/regression/usr.bin/sed tools/regression/usr.bin/sed/regress.multitest.out usr.bin/sed

2009-09-20 Thread Diomidis Spinellis
Author: dds
Date: Sun Sep 20 15:17:40 2009
New Revision: 197361
URL: http://svn.freebsd.org/changeset/base/197361

Log:
  Follow POSIX (IEEE Std 1003.1, 2004 Edition) in the implementation
  of the y (translate) command.
  
  If a backslash character is immediately followed by a backslash
  character in string1 or string2, the two backslash characters shall
  be counted as a single literal backslash character
  
  Pointed by:   Marius Strobl
  Obtained from:Mac OS X

Added:
  head/tools/regression/usr.bin/sed/regress.multitest.out/8.21   (contents, 
props changed)
Modified:
  head/tools/regression/usr.bin/sed/multitest.t
  head/usr.bin/sed/compile.c

Modified: head/tools/regression/usr.bin/sed/multitest.t
==
--- head/tools/regression/usr.bin/sed/multitest.t   Sun Sep 20 15:04:50 
2009(r197360)
+++ head/tools/regression/usr.bin/sed/multitest.t   Sun Sep 20 15:17:40 
2009(r197361)
@@ -445,6 +445,10 @@ u2/g' lines1
# set specification (both with --posix and without).
mark '8.19' ; sed 's/l/[/' lines1 | $SED -e 's[\[.[X['
mark '8.20' ; sed 's/l/[/' lines1 | $SED -e 's[\[.[X\[['
+   COMMENT='\ in y command'
+   mark '8.21'
+   echo 'a\b(c' |
+   $SED 'y%ABCDEFGHIJKLMNOPQRSTUVWXYZ, 
/\\()%abcdefghijklmnopqrstuvwxyz,--%'
 }
 
 test_error()

Added: head/tools/regression/usr.bin/sed/regress.multitest.out/8.21
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/regression/usr.bin/sed/regress.multitest.out/8.21Sun Sep 
20 15:17:40 2009(r197361)
@@ -0,0 +1 @@
+a-b-c

Modified: head/usr.bin/sed/compile.c
==
--- head/usr.bin/sed/compile.c  Sun Sep 20 15:04:50 2009(r197360)
+++ head/usr.bin/sed/compile.c  Sun Sep 20 15:17:40 2009(r197361)
@@ -66,7 +66,7 @@ static struct labhash {
 
 static char *compile_addr(char *, struct s_addr *);
 static char *compile_ccl(char **, char *);
-static char *compile_delimited(char *, char *);
+static char *compile_delimited(char *, char *, int);
 static char *compile_flags(char *, struct s_subst *);
 static regex_t  *compile_re(char *, int);
 static char *compile_subst(char *, struct s_subst *);
@@ -320,7 +320,7 @@ nonsel: /* Now parse the command */
linenum, fname);
if ((cmd-u.s = calloc(1, sizeof(struct s_subst))) == 
NULL)
err(1, malloc);
-   p = compile_delimited(p, re);
+   p = compile_delimited(p, re, 0);
if (p == NULL)
errx(1,
%lu: %s: unterminated substitute pattern, 
linenum, fname);
@@ -373,7 +373,7 @@ nonsel: /* Now parse the command */
  * with the processed string.
  */
 static char *
-compile_delimited(char *p, char *d)
+compile_delimited(char *p, char *d, int is_tr)
 {
char c;
 
@@ -399,9 +399,12 @@ compile_delimited(char *p, char *d)
*d++ = '\n';
p += 2;
continue;
-   } else if (*p == '\\'  p[1] == '\\')
-   *d++ = *p++;
-   else if (*p == c) {
+   } else if (*p == '\\'  p[1] == '\\') {
+   if (is_tr)
+   p++;
+   else
+   *d++ = *p++;
+   } else if (*p == c) {
*d = '\0';
return (p + 1);
}
@@ -654,11 +657,11 @@ compile_tr(char *p, struct s_tr **py)
errx(1,
%lu: %s: transform pattern can not be delimited by newline or 
backslash,
linenum, fname);
-   p = compile_delimited(p, old);
+   p = compile_delimited(p, old, 1);
if (p == NULL)
errx(1, %lu: %s: unterminated transform source string,
linenum, fname);
-   p = compile_delimited(p - 1, new);
+   p = compile_delimited(p - 1, new, 1);
if (p == NULL)
errx(1, %lu: %s: unterminated transform target string,
linenum, fname);
@@ -781,7 +784,7 @@ compile_addr(char *p, struct s_addr *a)
++p;
/* FALLTHROUGH */
case '/':   /* Context address */
-   p = compile_delimited(p, re);
+   p = compile_delimited(p, re, 0);
if (p == NULL)
errx(1, %lu: %s: unterminated regular expression, 
linenum, fname);
/* Check for case insensitive regexp flag */

svn commit: r197362 - in head: tools/regression/usr.bin/sed tools/regression/usr.bin/sed/regress.multitest.out usr.bin/sed

2009-09-20 Thread Diomidis Spinellis
Author: dds
Date: Sun Sep 20 15:47:31 2009
New Revision: 197362
URL: http://svn.freebsd.org/changeset/base/197362

Log:
  IEEE Std 1003.1, 2004 Edition states:
  
  The escape sequence '\n' shall match a newline embedded in
  the pattern space.
  
  It is unclear whether this also applies to a \n embedded in a
  character class.  Disable the existing handling of \n in a character
  class following Mac OS X, GNU sed version 4.1.5 with --posix, and
  SunOS 5.10 /usr/bin/sed.
  
  Pointed by:   Marius Strobl
  Obtained from:Mac OS X

Added:
  head/tools/regression/usr.bin/sed/regress.multitest.out/8.22   (contents, 
props changed)
  head/tools/regression/usr.bin/sed/regress.multitest.out/8.23   (contents, 
props changed)
Modified:
  head/tools/regression/usr.bin/sed/multitest.t
  head/usr.bin/sed/compile.c

Modified: head/tools/regression/usr.bin/sed/multitest.t
==
--- head/tools/regression/usr.bin/sed/multitest.t   Sun Sep 20 15:17:40 
2009(r197361)
+++ head/tools/regression/usr.bin/sed/multitest.t   Sun Sep 20 15:47:31 
2009(r197362)
@@ -449,6 +449,9 @@ u2/g' lines1
mark '8.21'
echo 'a\b(c' |
$SED 'y%ABCDEFGHIJKLMNOPQRSTUVWXYZ, 
/\\()%abcdefghijklmnopqrstuvwxyz,--%'
+   COMMENT='\n in a character class and a BRE'
+   mark '8.22' ; (echo 1; echo 2) | $SED -n '1{;N;s/[\n]/X/;p;}'
+   mark '8.23' ; (echo 1; echo 2) | $SED -n '1{;N;s/\n/X/;p;}'
 }
 
 test_error()

Added: head/tools/regression/usr.bin/sed/regress.multitest.out/8.22
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/regression/usr.bin/sed/regress.multitest.out/8.22Sun Sep 
20 15:47:31 2009(r197362)
@@ -0,0 +1,2 @@
+1
+2

Added: head/tools/regression/usr.bin/sed/regress.multitest.out/8.23
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/regression/usr.bin/sed/regress.multitest.out/8.23Sun Sep 
20 15:47:31 2009(r197362)
@@ -0,0 +1 @@
+1X2

Modified: head/usr.bin/sed/compile.c
==
--- head/usr.bin/sed/compile.c  Sun Sep 20 15:17:40 2009(r197361)
+++ head/usr.bin/sed/compile.c  Sun Sep 20 15:47:31 2009(r197362)
@@ -432,8 +432,7 @@ compile_ccl(char **sp, char *t)
for (c = *s; (*t = *s) != ']' || c != d; s++, t++)
if ((c = *s) == '\0')
return NULL;
-   } else if (*s == '\\'  s[1] == 'n')
-   *t = '\n', s++;
+   }
return (*s == ']') ? *sp = ++s, ++t : NULL;
 }
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r197245 - head/lib/libc/regex

2009-09-16 Thread Diomidis Spinellis
Author: dds
Date: Wed Sep 16 06:29:23 2009
New Revision: 197245
URL: http://svn.freebsd.org/changeset/base/197245

Log:
  Add a couple of debugging statements.

Modified:
  head/lib/libc/regex/engine.c

Modified: head/lib/libc/regex/engine.c
==
--- head/lib/libc/regex/engine.cWed Sep 16 05:33:15 2009
(r197244)
+++ head/lib/libc/regex/engine.cWed Sep 16 06:29:23 2009
(r197245)
@@ -247,6 +247,8 @@ matcher(struct re_guts *g,
if (g-moffset  -1)
start = ((dp - g-moffset)  start) ? start : dp - g-moffset;
 
+   SP(mloop, m-st, *start);
+
/* this loop does only one repetition except for backrefs */
for (;;) {
endp = fast(m, start, stop, gf, gl);
@@ -787,6 +789,7 @@ fast(   struct match *m,
 
CLEAR(st);
SET1(st, startst);
+   SP(fast, st, *p);
st = step(m-g, startst, stopst, st, NOTHING, st);
ASSIGN(fresh, st);
SP(start, st, *p);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r197246 - head/lib/libc/regex

2009-09-16 Thread Diomidis Spinellis
Author: dds
Date: Wed Sep 16 06:32:23 2009
New Revision: 197246
URL: http://svn.freebsd.org/changeset/base/197246

Log:
  Fix an off-by-one error in the marking of the O_CH operator
  following an OOR2 operator.
  
  PR:   130504
  MFC after:2 weeks

Modified:
  head/lib/libc/regex/engine.c

Modified: head/lib/libc/regex/engine.c
==
--- head/lib/libc/regex/engine.cWed Sep 16 06:29:23 2009
(r197245)
+++ head/lib/libc/regex/engine.cWed Sep 16 06:32:23 2009
(r197246)
@@ -1075,7 +1075,7 @@ step(struct re_guts *g,
OP(s = g-strip[pc+look]) != 
O_CH;
look += OPND(s))
assert(OP(s) == OOR2);
-   FWD(aft, aft, look);
+   FWD(aft, aft, look + 1);
}
break;
case OOR2:  /* propagate OCH_'s marking */
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r197234 - head/lib/libc/regex/grot

2009-09-15 Thread Diomidis Spinellis
Author: dds
Date: Tue Sep 15 21:15:29 2009
New Revision: 197234
URL: http://svn.freebsd.org/changeset/base/197234

Log:
  Add two test cases from PR 130504.
  An additional one coming from http://www.research.att.com/~gsf/testregex/
  was not added; at some point the entire ATT regression test harness
  should be imported here.
  But that would also mean commitment to fix the uncovered errors.
  
  PR:   130504
  Submitted by: Chris Kuklewicz

Modified:
  head/lib/libc/regex/grot/tests

Modified: head/lib/libc/regex/grot/tests
==
--- head/lib/libc/regex/grot/tests  Tue Sep 15 20:28:29 2009
(r197233)
+++ head/lib/libc/regex/grot/tests  Tue Sep 15 21:15:29 2009
(r197234)
@@ -472,3 +472,6 @@ abcdefghijklmnopi   abcdefghijklmnopabcd
 abcdefghijklmnopqrstuv i   abcdefghijklmnopqrstuv  abcdefghijklmnopqrstuv
 (ALAK)|(ALT[AB])|(CC[123]1)|(CM[123]1)|(GAMC)|(LC[23][EO 
])|(SEM[1234])|(SL[ES][12])|(SLWW)|(SLF 
)|(SLDT)|(VWH[12])|(WH[34][EW])|(WP1[ESN])-   CC11CC11
 CC[13]1|a{21}[23][EO][123][Es][12]a{15}aa[34][EW]aaa[X]a   -   CC11
CC11
+# PR 130504
+(.|())(b)  -   ab  ab
+(()|.)(b)  -   ab  ab
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r192040 - head/usr.bin/truss

2009-05-13 Thread Diomidis Spinellis
Author: dds
Date: Wed May 13 12:43:37 2009
New Revision: 192040
URL: http://svn.freebsd.org/changeset/base/192040

Log:
  Fix compilation error introduced in r192025.

Modified:
  head/usr.bin/truss/mips-fbsd.c

Modified: head/usr.bin/truss/mips-fbsd.c
==
--- head/usr.bin/truss/mips-fbsd.c  Wed May 13 12:19:54 2009
(r192039)
+++ head/usr.bin/truss/mips-fbsd.c  Wed May 13 12:43:37 2009
(r192040)
@@ -338,7 +338,8 @@ mips_syscall_exit(struct trussinfo *trus
* but that complicates things considerably.
*/
 
-  print_syscall_ret(trussinfo, fsc.name, fsc.nargs, fsc.s_args, errorp, 
retval);
+  print_syscall_ret(trussinfo, fsc.name, fsc.nargs, fsc.s_args, errorp,
+   fsc.sc, retval);
   clear_fsc();
 
   return (retval);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r192041 - head/usr.bin/truss

2009-05-13 Thread Diomidis Spinellis
Author: dds
Date: Wed May 13 13:00:52 2009
New Revision: 192041
URL: http://svn.freebsd.org/changeset/base/192041

Log:
  Fix print_syscall_ret parameter order.

Modified:
  head/usr.bin/truss/mips-fbsd.c

Modified: head/usr.bin/truss/mips-fbsd.c
==
--- head/usr.bin/truss/mips-fbsd.c  Wed May 13 12:43:37 2009
(r192040)
+++ head/usr.bin/truss/mips-fbsd.c  Wed May 13 13:00:52 2009
(r192041)
@@ -339,7 +339,7 @@ mips_syscall_exit(struct trussinfo *trus
*/
 
   print_syscall_ret(trussinfo, fsc.name, fsc.nargs, fsc.s_args, errorp,
-   fsc.sc, retval);
+   retval, fsc.sc);
   clear_fsc();
 
   return (retval);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r192025 - head/usr.bin/truss

2009-05-12 Thread Diomidis Spinellis
Author: dds
Date: Tue May 12 20:42:12 2009
New Revision: 192025
URL: http://svn.freebsd.org/changeset/base/192025

Log:
  Add -c option to summarize number of calls, errors, and system time.
  
  Reviewed by:  alfred

Modified:
  head/usr.bin/truss/amd64-fbsd.c
  head/usr.bin/truss/amd64-fbsd32.c
  head/usr.bin/truss/amd64-linux32.c
  head/usr.bin/truss/i386-fbsd.c
  head/usr.bin/truss/i386-linux.c
  head/usr.bin/truss/ia64-fbsd.c
  head/usr.bin/truss/main.c
  head/usr.bin/truss/powerpc-fbsd.c
  head/usr.bin/truss/sparc64-fbsd.c
  head/usr.bin/truss/syscall.h
  head/usr.bin/truss/syscalls.c
  head/usr.bin/truss/truss.1
  head/usr.bin/truss/truss.h

Modified: head/usr.bin/truss/amd64-fbsd.c
==
--- head/usr.bin/truss/amd64-fbsd.c Tue May 12 19:33:36 2009
(r192024)
+++ head/usr.bin/truss/amd64-fbsd.c Tue May 12 20:42:12 2009
(r192025)
@@ -323,7 +323,8 @@ amd64_syscall_exit(struct trussinfo *tru
* but that complicates things considerably.
*/
 
-  print_syscall_ret(trussinfo, fsc.name, fsc.nargs, fsc.s_args, errorp, 
retval);
+  print_syscall_ret(trussinfo, fsc.name, fsc.nargs, fsc.s_args, errorp,
+   retval, fsc.sc);
   clear_fsc();
 
   return (retval);

Modified: head/usr.bin/truss/amd64-fbsd32.c
==
--- head/usr.bin/truss/amd64-fbsd32.c   Tue May 12 19:33:36 2009
(r192024)
+++ head/usr.bin/truss/amd64-fbsd32.c   Tue May 12 20:42:12 2009
(r192025)
@@ -339,7 +339,8 @@ amd64_fbsd32_syscall_exit(struct trussin
* but that complicates things considerably.
*/
 
-  print_syscall_ret(trussinfo, fsc.name, fsc.nargs, fsc.s_args, errorp, 
retval);
+  print_syscall_ret(trussinfo, fsc.name, fsc.nargs, fsc.s_args, errorp,
+   retval, fsc.sc);
   clear_fsc();
 
   return (retval);

Modified: head/usr.bin/truss/amd64-linux32.c
==
--- head/usr.bin/truss/amd64-linux32.c  Tue May 12 19:33:36 2009
(r192024)
+++ head/usr.bin/truss/amd64-linux32.c  Tue May 12 20:42:12 2009
(r192025)
@@ -309,7 +309,7 @@ amd64_linux32_syscall_exit(struct trussi
   }
 
   print_syscall_ret(trussinfo, fsc.name, fsc.nargs, fsc.s_args, errorp,
-errorp ? i : retval);
+errorp ? i : retval, fsc.sc);
   clear_fsc();
 
   return (retval);

Modified: head/usr.bin/truss/i386-fbsd.c
==
--- head/usr.bin/truss/i386-fbsd.c  Tue May 12 19:33:36 2009
(r192024)
+++ head/usr.bin/truss/i386-fbsd.c  Tue May 12 20:42:12 2009
(r192025)
@@ -329,7 +329,8 @@ i386_syscall_exit(struct trussinfo *trus
* but that complicates things considerably.
*/
 
-  print_syscall_ret(trussinfo, fsc.name, fsc.nargs, fsc.s_args, errorp, 
retval);
+  print_syscall_ret(trussinfo, fsc.name, fsc.nargs, fsc.s_args, errorp,
+   retval, fsc.sc);
   clear_fsc();
 
   return (retval);

Modified: head/usr.bin/truss/i386-linux.c
==
--- head/usr.bin/truss/i386-linux.c Tue May 12 19:33:36 2009
(r192024)
+++ head/usr.bin/truss/i386-linux.c Tue May 12 20:42:12 2009
(r192025)
@@ -309,7 +309,7 @@ i386_linux_syscall_exit(struct trussinfo
   }
 
   print_syscall_ret(trussinfo, fsc.name, fsc.nargs, fsc.s_args, errorp,
-errorp ? i : retval);
+errorp ? i : retval, fsc.sc);
   clear_fsc();
 
   return (retval);

Modified: head/usr.bin/truss/ia64-fbsd.c
==
--- head/usr.bin/truss/ia64-fbsd.c  Tue May 12 19:33:36 2009
(r192024)
+++ head/usr.bin/truss/ia64-fbsd.c  Tue May 12 20:42:12 2009
(r192025)
@@ -294,7 +294,8 @@ ia64_syscall_exit(struct trussinfo *trus
* but that complicates things considerably.
*/
 
-  print_syscall_ret(trussinfo, fsc.name, fsc.nargs, fsc.s_args, errorp, 
retval);
+  print_syscall_ret(trussinfo, fsc.name, fsc.nargs, fsc.s_args, errorp,
+   fsc.sc, retval);
   clear_fsc();
 
   return (retval);

Modified: head/usr.bin/truss/main.c
==
--- head/usr.bin/truss/main.c   Tue May 12 19:33:36 2009(r192024)
+++ head/usr.bin/truss/main.c   Tue May 12 20:42:12 2009(r192025)
@@ -58,6 +58,7 @@ __FBSDID($FreeBSD$);
 
 #include truss.h
 #include extern.h
+#include syscall.h
 
 #define MAXARGS 6
 
@@ -65,8 +66,8 @@ static void
 usage(void)
 {
fprintf(stderr, %s\n%s\n,
-   usage: truss [-faedDS] [-o file] [-s strsize] -p pid,
-  truss [-faedDS] [-o file] [-s strsize] command [args]);
+   usage: truss [-cfaedDS] [-o file] [-s strsize] -p 

svn commit: r190464 - head/lib/libc/sys

2009-03-27 Thread Diomidis Spinellis
Author: dds
Date: Fri Mar 27 11:03:02 2009
New Revision: 190464
URL: http://svn.freebsd.org/changeset/base/190464

Log:
  Document missing requests.

Modified:
  head/lib/libc/sys/ptrace.2

Modified: head/lib/libc/sys/ptrace.2
==
--- head/lib/libc/sys/ptrace.2  Fri Mar 27 05:48:42 2009(r190463)
+++ head/lib/libc/sys/ptrace.2  Fri Mar 27 11:03:02 2009(r190464)
@@ -2,7 +2,7 @@
 .\$NetBSD: ptrace.2,v 1.2 1995/02/27 12:35:37 cgd Exp $
 .\
 .\ This file is in the public domain.
-.Dd April 9, 2007
+.Dd March 27, 2009
 .Dt PTRACE 2
 .Os
 .Sh NAME
@@ -77,7 +77,8 @@ special case noted below, all
 .Fn ptrace
 calls are made by the tracing process, and the
 .Fa pid
-argument specifies the process ID of the traced process.
+argument specifies the process ID of the traced process
+or a corresponding thread ID.
 The
 .Fa request
 argument
@@ -311,6 +312,21 @@ with the array size specified by
 The return value from
 .Fn ptrace
 is the count of array entries filled in.
+.It PT_SETSTEP
+This request will turn on single stepping of the specified process.
+.It PT_CLEARSTEP
+This request will turn off single stepping of the specified process.
+.It PT_SUSPEND
+This request will suspend the specified thread.
+.It PT_RESUME
+This request will resume the specified thread.
+.It PT_TO_SCE
+This request will trace the specified process on each system call entry.
+.It PT_TO_SCX
+This request will trace the specified process on each system call exit.
+.It PT_SYSCALL
+This request will trace the specified process
+on each system call entry and exit.
 .El
 .Pp
 Additionally, machine-specific requests can exist.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r188068 - stable/7/usr.bin/sed

2009-02-03 Thread Diomidis Spinellis
Author: dds
Date: Tue Feb  3 12:56:05 2009
New Revision: 188068
URL: http://svn.freebsd.org/changeset/base/188068

Log:
  MFC 184854 from head to stable/7
  
  Fix the code to conform to the or more part of the following POSIX
  specification and regression test regress:25.
  
  A function can be preceded by one or more '!' characters, in which
  case the function shall be applied if the addresses do not select
  the pattern space.
  
  _M   7/usr.bin/sed
  M7/usr.bin/sed/compile.c

Modified:
  stable/7/usr.bin/sed/   (props changed)
  stable/7/usr.bin/sed/compile.c

Modified: stable/7/usr.bin/sed/compile.c
==
--- stable/7/usr.bin/sed/compile.c  Tue Feb  3 11:04:03 2009
(r188067)
+++ stable/7/usr.bin/sed/compile.c  Tue Feb  3 12:56:05 2009
(r188068)
@@ -224,7 +224,7 @@ nonsel: /* Now parse the command */
case NONSEL:/* ! */
p++;
EATSPACE();
-   cmd-nonsel = ! cmd-nonsel;
+   cmd-nonsel = 1;
goto nonsel;
case GROUP: /* { */
p++;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r188069 - stable/7/bin/cp

2009-02-03 Thread Diomidis Spinellis

Robert Watson wrote:

On Tue, 3 Feb 2009, Diomidis Spinellis wrote:


Author: dds
Date: Tue Feb  3 13:07:34 2009
New Revision: 188069
URL: http://svn.freebsd.org/changeset/base/188069

Log:
 MFC r184342 from head to stable/7

 Add fallback when mmap fails on regular files.  Some filesystems,
 like smbnetfs, do not support mmap.


You mean smbfs?


The original report of the problem 
http://lists.freebsd.org/pipermail/freebsd-current/2008-May/085866.html 
concerned SMBNetFS - a user-space implementation of SMB 
http://sourceforge.net/projects/smbnetfs.


Diomidis Spinellis - http://www.dmst.aueb.gr/dds
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r184852 - head/tools/regression/usr.bin/sed

2008-11-11 Thread Diomidis Spinellis
Author: dds
Date: Tue Nov 11 17:10:24 2008
New Revision: 184852
URL: http://svn.freebsd.org/changeset/base/184852

Log:
  Add a test for the or more part of the following POSIX specification.
  
A function can be preceded by one or more '!' characters, in which
case the function shall be applied if the addresses do not select
the pattern space.

Added:
  head/tools/regression/usr.bin/sed/regress.not.out   (contents, props changed)
Modified:
  head/tools/regression/usr.bin/sed/regress.sh

Added: head/tools/regression/usr.bin/sed/regress.not.out
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/regression/usr.bin/sed/regress.not.out   Tue Nov 11 17:10:24 
2008(r184852)
@@ -0,0 +1 @@
+foo

Modified: head/tools/regression/usr.bin/sed/regress.sh
==
--- head/tools/regression/usr.bin/sed/regress.shTue Nov 11 15:51:45 
2008(r184851)
+++ head/tools/regression/usr.bin/sed/regress.shTue Nov 11 17:10:24 
2008(r184852)
@@ -2,7 +2,7 @@
 
 REGRESSION_START($1)
 
-echo '1..24'
+echo '1..25'
 
 REGRESSION_TEST(`G', `sed G  regress.in')
 REGRESSION_TEST(`P', `sed P  regress.in')
@@ -69,5 +69,6 @@ REGRESSION_TEST(`icase3', `sed s/SED/Foo
 
 REGRESSION_TEST(`hanoi', `echo :abcd: : : | sed -f hanoi.sed')
 REGRESSION_TEST(`math', `echo 4+7*3+2^7/3 | sed -f math.sed')
+REGRESSION_TEST(`not', `echo foo | sed 1!!s/foo/bar/')
 
 REGRESSION_END()
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to [EMAIL PROTECTED]


svn commit: r184854 - head/usr.bin/sed

2008-11-11 Thread Diomidis Spinellis
Author: dds
Date: Tue Nov 11 17:15:57 2008
New Revision: 184854
URL: http://svn.freebsd.org/changeset/base/184854

Log:
  Fix the code to conform to the or more part of the following POSIX
  specification and regression test regress:25.
  
A function can be preceded by one or more '!' characters, in which
case the function shall be applied if the addresses do not select
the pattern space.
  
  MFC after:2 weeks

Modified:
  head/usr.bin/sed/compile.c

Modified: head/usr.bin/sed/compile.c
==
--- head/usr.bin/sed/compile.c  Tue Nov 11 17:12:26 2008(r184853)
+++ head/usr.bin/sed/compile.c  Tue Nov 11 17:15:57 2008(r184854)
@@ -224,7 +224,7 @@ nonsel: /* Now parse the command */
case NONSEL:/* ! */
p++;
EATSPACE();
-   cmd-nonsel = ! cmd-nonsel;
+   cmd-nonsel = 1;
goto nonsel;
case GROUP: /* { */
p++;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: svn commit: r184645 - head/usr.bin/vmstat

2008-11-04 Thread Diomidis Spinellis

On Nov 4, 2008, at 8:02 PM, Giorgos Keramidas wrote:


Author: keramida (doc committer)
Date: Tue Nov  4 18:02:35 2008
New Revision: 184645
URL: http://svn.freebsd.org/changeset/base/184645

Log:
  Repeat vmstat header after window.rows instead of a hardcoded 20.

  Use ioctl() to get the window size in vmstat(8), and force a new
  header to be prepended to the output every time the current window
  size changes.  Change the number of lines before each header to the
  current lines of the terminal when the terminal is resized, so that
  the full terminal length can be used for output lines.

  Inspired by:  svn change 175562 (same feature for iostat)
  Reviewed by:  ru (who fixed some of my bugs too)


Thanks!  This functionality is generally useful and tricky to code in  
a correct way.  Should we perhaps package it in a library function,  
so that all header-printing commands can benefit from it, without  
repeating the code?


Diomidis Spinellis - dds@
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to [EMAIL PROTECTED]


svn commit: r184325 - svnadmin/conf

2008-10-27 Thread Diomidis Spinellis
Author: dds
Date: Mon Oct 27 07:01:14 2008
New Revision: 184325
URL: http://svn.freebsd.org/changeset/base/184325

Log:
  Add Konrad Jankowski (versus@) as a new src committer.  Konrad will
  start his work with the i18n improvements he performed during GSoC
  2008.  I will be his mentor.
  
  Approved by:  core

Modified:
  svnadmin/conf/access
  svnadmin/conf/mentors

Modified: svnadmin/conf/access
==
--- svnadmin/conf/accessMon Oct 27 06:34:41 2008(r184324)
+++ svnadmin/conf/accessMon Oct 27 07:01:14 2008(r184325)
@@ -235,6 +235,7 @@ twinterg
 ume
 ups
 vanhu
+versus
 weongyo
 wes[EMAIL PROTECTED]
 wilko  [EMAIL PROTECTED]

Modified: svnadmin/conf/mentors
==
--- svnadmin/conf/mentors   Mon Oct 27 06:34:41 2008(r184324)
+++ svnadmin/conf/mentors   Mon Oct 27 07:01:14 2008(r184325)
@@ -18,4 +18,5 @@ sbrunoscottl
 sson   jb
 stas   kib
 trasz  rwatson
+versus dds
 zecjulian  Co-mentor: silby
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to [EMAIL PROTECTED]