of *course* I had to introduce an inverse-logic error

d'oh. the XOR check's result needs to be reversed, as it tests for validity
This commit is contained in:
tg 2009-04-07 19:25:41 +00:00
parent a3cfe7d2cf
commit c841d1513d
1 changed files with 2 additions and 2 deletions

4
shf.c
View File

@ -2,7 +2,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/shf.c,v 1.26 2009/04/07 19:08:25 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/shf.c,v 1.27 2009/04/07 19:25:41 tg Exp $");
/* flags to shf_emptybuf() */
#define EB_READSW 0x01 /* about to switch to reading */
@ -175,7 +175,7 @@ struct shf *
shf_sopen(char *buf, int bsize, int sflags, struct shf *shf)
{
/* can't have a read+write string */
if (!(sflags & SHF_RD) ^ !(sflags & SHF_WR))
if (!(!(sflags & SHF_RD) ^ !(sflags & SHF_WR)))
internal_errorf("shf_sopen: flags 0x%x", sflags);
if (!shf) {