rem: if (*mode == 'b') {
add: i = 2; while (i-- && (*mode != '\0')) { switch (*mode) { case 'b': #ifdef WIN32 openFlags |= O_BINARY; #endif break; case 't': #ifdef WIN32 openFlags |= O_TEXT; #endif break; case '+': openFlags = (openFlags & ~O_ACCMODE) | O_RDWR; break; default: i = 0;  break; }
context: uio_fopen(uio_DirHandle *dir, const char *path, const char *mode) {	int openFlags;	uio_Handle *handle;	uio_Stream *stream;		switch (*mode) {		case 'r':			openFlags = O_RDONLY;			break;		case 'w':			openFlags = O_WRONLY | O_CREAT | O_TRUNC;			break;		case 'a':			openFlags = O_WRONLY| O_CREAT | O_APPEND;		default:			errno = EINVAL;			fprintf(stderr, "Invalid mode string in call to uio_fopen().\n");			return NULL;	}	mode++;	// 'b' may either be the second or the third character.	if (*mode == 'b') {		mode++;#ifdef WIN32		openFlags |= O_BINARY;#endif		if (*mode == '+') {			mode++;			openFlags = (openFlags & ~O_ACCMODE) | O_RDWR;		}	} else	if (*mode == '+') {		mode++;		openFlags = (openFlags & ~O_ACCMODE) | O_RDWR;	}	// Any characters in the mode string that might follow are ignored.		handle = uio_open(dir, path, openFlags, S_IRUSR | S_IWUSR |			S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);	if (handle == NULL) {		// errno is set		return NULL;	}	stream = uio_Stream_new(handle, openFlags);	return stream;}