From mboxrd@z Thu Jan 1 00:00:00 1970 From: arisawa Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <8F8671EF-BA2B-446D-97ED-D8BB4F6C947F@ar.aichi-u.ac.jp> Date: Sun, 16 Nov 2014 13:36:54 +0900 To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: [9fans] inconsistent comparison? Topicbox-Message-UUID: 282853de-ead9-11e9-9d60-3106f5b1d025 Hello, /sys/lib/mimetype is referenced in three files: /sys/src/cmd/ip/httpd/content.c # for outgoing file /sys/src/cmd/upas/marshal/marshal.c # for outgoing file /usr/arisawa/src/upas/vf/vf.c # for incoming file the codes are as follows. /sys/src/cmd/ip/httpd/content.c /sys/src/cmd/ip/httpd/content.c while((p = strrchr(buf, '.')) != nil){ for(s = suffixes; s; s = s->next){ if(strcmp(p, s->suffix) == 0){ if(s->generic != nil && type == nil) type = hmkcontent(hc, s->generic, s->specific, nil); if(s->encoding != nil && enc == nil) enc = hmkcontent(hc, s->encoding, nil, nil); } } *p = 0; } /sys/src/cmd/upas/marshal/marshal.c /* try the mime types file */ if(p != nil){ if(mimetypes == nil) readmimetypes(); for(c = mimetypes; c != nil && c->ext != nil; c++) if(strcmp(p, c->ext) == 0){ a->type = c->type; a->ctype = c; return a; } } /sys/src/cmd/upas/vf/vf.c for(m = mtypes; m != nil; m = m->next) if(cistrcmp(p, m->ext) == 0){ switch(m->class){ case 'm': case 'y': return 0; case 'p': *p = 0; rv = badfile(name); *p = '.'; return rv; case 'r': return 2; } } these codes are in 9front but probably same as both official plan9 and 9atom. note that vf.c uses cistrcmp() but others use strcmp(). this these are intensional?