OK, turing.

<- leave blank

Fri Apr 13 14:53:47 EDT 2018

diff -r 4e9625a45b08 sys/src/cmd/test.c
--- a/sys/src/cmd/test.c Sat Mar 31 12:41:41 2018 +0000
+++ b/sys/src/cmd/test.c Fri Apr 13 20:53:37 2018 +0200
@@ -87,7 +87,7 @@

	p1 = e1();
	if (EQ(nxtarg(1), "-o"))
- return(p1 || e());
+ return(e() || p1);
	ap--;
	return(p1);
 }
@@ -99,7 +99,7 @@

	p1 = e2();
	if (EQ(nxtarg(1), "-a"))
- return (p1 && e1());
+ return (e1() && p1);
	ap--;
	return(p1);
 }


Fri Apr 13 14:27:54 EDT 2018
current behaviour

cd /sys/src/cmd; test '(' -f /dev/null && echo 'test passes' || echo 'test fails'
test: argument expected
test fails

with that change:
cd /sys/src/cmd; test '(' -f /dev/null && echo 'test passes' || echo 'test fails'
test passes

Fri Apr 13 14:19:57 EDT 2018
cd /sys/src/cmd; ./test '(' ! -f does-not-exist -o -f /dev/null ')' && echo 'test
passes' || echo 'test fails'
test passes
cd /sys/src/cmd; ./test '(' ! -f does-not-exist ')' && echo 'test passes' || echo
'test fails'
test passes
cd /sys/src/cmd; ./test '(' ! -f does-not-exist ')' && echo 'test passes' || echo
'test fails'
test passes
cd /sys/src/cmd; ./test '(' -f does-not-exist ')' && echo 'test passes' || echo
'test fails'
test fails
cd /sys/src/cmd; ./test '(' ! -f does-not-exist -o -f /dev/null ')' -a -f
/dev/null && echo 'test passes' || echo 'test fails'
test passes

Fri Apr 13 14:19:13 EDT 2018
diff -r 50b5db9fc3e7 sys/src/cmd/test.c
--- a/sys/src/cmd/test.c Mon Apr 09 16:34:25 2018 -0700
+++ b/sys/src/cmd/test.c Fri Apr 13 11:18:57 2018 -0700
@@ -122,8 +122,6 @@
	a = nxtarg(0);
	if(EQ(a, "(")) {
		p1 = e();
- if(!EQ(nxtarg(0), ")"))
- synbad(") expected","");
		return(p1);
	}


Fri Apr 13 13:48:25 EDT 2018
cd /tmp; test '(' ! -f junk-does-not-exist -o -f /dev/null ')' && echo 'test
passes' || echo 'test fails'
test: ) expected
test fails
cd /tmp; test '(' ! -f junk-does-not-exist ')' && echo 'test passes' || echo 'test
fails'
test passes
cd /tmp; test '(' ! -f junk-does-not-exist -o -f /dev/null ')' -a -f /dev/null &&
echo 'test passes' || echo 'test fails'
test: ) expected
test fails
cd /tmp;

Fri Apr 13 13:46:16 EDT 2018
cd /tmp; test '(' ! -f junk-does-not-exist -o -f /dev/null ')' && echo 'test
passes' || echo 'test fails'
test: ) expected
test fails
cd /tmp; test '(' ! -f junk-does-not-exist ')' && echo 'test passes' || echo 'test
fails'
test passes
cd /tmp;

Fri Apr 13 11:41:02 EDT 2018
#!/bin/rc

debug = 1

fn testfn {
  echo 'debug: '$debug
  arg1 = $1
  arg2 = $2
  arg3 = $3
  echo $arg1 $arg2 $arg3
}

{
  echo 'arg1'
  echo 'arg2'
  echo 'arg3'
} | xargs -n 3 echo

# this will not work as it becomes recursive calls.
# would have to split the testfn into a different file
{
  echo 'arg1'
  echo 'arg2'
  echo 'arg3'
} | xargs -n 3 rc -xvc 'cd '^`{pwd}^'; . test.rc; testfn $*'


Fri Apr 13 09:42:54 EDT 2018
dark ux

Fri Apr 13 09:38:14 EDT 2018
Hello.  I reached my question limit on StackOverflow, which means I am not able to
ask any questions anymore.

Fri Apr 13 06:52:16 EDT 2018
test


Thu Apr 12 23:08:17 EDT 2018
diff /sys/src/cmd/rio/data.c ./data.c
174a175,193
> Image*
> wallpaper()
> {
> char* home = getenv("home");
> char* wallpath = "/lib/wallpaper";
> char* fullpath = malloc(sizeof(char) * (strlen(home) + strlen(wallpath) +
1));
> strcpy(fullpath, home);
> strcat(fullpath, wallpath);
> int fp = open(fullpath, OREAD);
> if (fp != -1){
> Image* wall = readimage(display, fp, 0);
> if (wall != 0){
> return wall;
> }
> }
>
> return allocimage(display, Rect(0,0,1,1), RGB24, 1, 0x777777FF);
> }
>
178c197
< background = allocimage(display, Rect(0,0,1,1), RGB24, 1, 0x777777FF);
---
> background = wallpaper();
diff /sys/src/cmd/rio/fns.h ./fns.h
5a6
> Image* wallpaper(void);


prev | next