9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] /sys/src/cmd/chmod.c
@ 2003-12-31 14:32 Lucio De Re
  2003-12-31 15:25 ` Martin Harriss
  2004-01-05 11:03 ` Zhen Lin
  0 siblings, 2 replies; 4+ messages in thread
From: Lucio De Re @ 2003-12-31 14:32 UTC (permalink / raw)
  To: 9fans mailing list

This struck me, looking at recent changes to chmod(1) which allow one
to flag a file as "not to be included in nightly archives":

	for(; *s ; s++){
		switch(*s){
		case 'r':
			mode |= A(DMREAD); break;
		case 'w':
			mode |= A(DMWRITE); break;
		case 'x':
			mode |= A(DMEXEC); break;
		case 'a':
			mode |= DMAPPEND; break;
		case 'l':
			mode |= DMEXCL; break;
		case 't':
			mode |= DMTMP; break;
		default:
			return 0;
		}
	}
	if(*s != 0)
		return 0;

I can't see how *s can be non-zero on exit from the for loop.  Is
my C programming _so_ rusty?!

++L


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-01-05 15:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-31 14:32 [9fans] /sys/src/cmd/chmod.c Lucio De Re
2003-12-31 15:25 ` Martin Harriss
2004-01-05 11:03 ` Zhen Lin
2004-01-05 15:26   ` ron minnich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).