This commit is contained in:
Russ Cox 2007-11-27 15:39:06 -05:00
commit 83ab7d8896
21 changed files with 239 additions and 107 deletions

View file

@ -538,7 +538,7 @@ xls(int argc, char **argv)
}
if(sort)
qsort(d, n, sizeof d[0], dircmp);
for(j=0; j<5; j++)
for(j=0; j<4; j++)
len[j] = 0;
for(i=0; i<n; i++){
d[i].type = 'M';

View file

@ -804,6 +804,8 @@ mountfuse(char *mtpt)
"/Contents/Resources/load_fusefs", 0) < 0 &&
access(f="/Library/Extensions/fusefs.kext"
"/Contents/Resources/load_fusefs", 0) < 0 &&
access(f="/Library/Filesystems"
"/fusefs.fs/Support/load_fusefs", 0) < 0 &&
access(f="/System/Library/Filesystems"
"/fusefs.fs/Support/load_fusefs", 0) < 0){
werrstr("cannot find load_fusefs");
@ -843,8 +845,15 @@ mountfuse(char *mtpt)
/*
* Different versions of MacFUSE put the
* mount_fusefs binary in different places.
* Try both.
* Try all.
*/
/* Leopard location */
putenv("MOUNT_FUSEFS_DAEMON_PATH",
"/Library/Filesystems/fusefs.fs/Support/mount_fusefs");
execl("/Library/Filesystems/fusefs.fs/Support/mount_fusefs",
"mount_fusefs", buf, mtpt, nil);
/* possible Tiger locations */
execl("/System/Library/Filesystems/fusefs.fs/mount_fusefs",
"mount_fusefs", buf, mtpt, nil);
execl("/System/Library/Filesystems/fusefs.fs/Support/mount_fusefs",

View file

@ -22,12 +22,21 @@
#ifndef O_DIRECTORY
#define O_DIRECTORY 0
#endif
#ifndef O_LARGEFILE
#if defined(__linux__)
#define O_LARGEFILE 0100000 /* Sigh */
#else
#define O_LARGEFILE 0
# if defined(__linux__)
# define O_LARGEFILE 0100000 /* Sigh */
# else
# define O_LARGEFILE 0
# endif
#endif
#ifndef O_CLOEXEC
# if defined(__linux__)
# define O_CLOEXEC 02000000 /* Sigh */
# else
# define O_CLOEXEC 0
# endif
#endif
@ -552,7 +561,7 @@ _fuseopen(FuseMsg *m, int isdir)
flags = in->flags;
openmode = flags&3;
flags &= ~3;
flags &= ~(O_DIRECTORY|O_NONBLOCK|O_LARGEFILE);
flags &= ~(O_DIRECTORY|O_NONBLOCK|O_LARGEFILE|O_CLOEXEC);
if(flags & O_TRUNC){
openmode |= OTRUNC;
flags &= ~O_TRUNC;

View file

@ -534,11 +534,12 @@ colwhich(Column *c, Point p)
for(i=0; i<c->nw; i++){
w = c->w[i];
if(ptinrect(p, w->r)){
if(ptinrect(p, w->tagtop) || ptinrect(p, w->tag.fr.r))
if(ptinrect(p, w->tagtop) || ptinrect(p, w->tag.all))
return &w->tag;
if(ptinrect(p, w->body.scrollr) || ptinrect(p, w->body.fr.r))
return &w->body;
return nil;
/* exclude partial line at bottom */
if(p.x >= w->body.scrollr.max.x && p.y >= w->body.fr.r.max.y)
return nil;
return &w->body;
}
}
return nil;

View file

@ -365,11 +365,11 @@ search(Text *ct, Rune *r, uint n)
fbuffree(s);
return TRUE;
}
if(around && q>=ct->q1)
break;
--nb;
b++;
q++;
if(around && q>=ct->q1)
break;
}
fbuffree(s);
return FALSE;

View file

@ -569,13 +569,19 @@ int
imapcopylist(Imap *z, char *nbox, Msg **m, uint nm)
{
int rv;
char *name;
char *name, *p;
if(nm == 0)
return 0;
qlock(&z->lk);
name = esmprint("%Z", nbox);
if(strcmp(nbox, "mbox") == 0)
name = estrdup("INBOX");
else{
p = esmprint("%s%s", z->root, nbox);
name = esmprint("%Z", p);
free(p);
}
rv = imaplistcmd(z, m[0]->box, "UID COPY", m, nm, name);
free(name);
qunlock(&z->lk);

View file

@ -24,7 +24,7 @@ main(void)
while((p = Brdstr(&b, '\n', 1)) != nil){
if(p[0] == 0)
break;
if(strncmp(p, "Content-Transfer-Encoding: ", 27) == 0)
if(cistrncmp(p, "Content-Transfer-Encoding: ", 27) == 0)
encoding = strdup(p+27);
free(p);
}

View file

@ -33,7 +33,7 @@ main(int argc, char **argv)
if((disk = diskcache(disk, 16384, 16)) == nil)
sysfatal("diskcache: %r");
if((fsys = fsysopen(disk)) == nil)
sysfatal("ffsopen: %r");
sysfatal("fsysopen: %r");
zero = emalloc(fsys->blocksize);
fprint(2, "%d blocks total\n", fsys->nblock);

View file

@ -72,7 +72,7 @@ threadmain(int argc, char **argv)
if((disk = diskcache(disk, 16384, 16)) == nil)
sysfatal("diskcache: %r");
if((fsys = fsysopen(disk)) == nil)
sysfatal("ffsopen: %r");
sysfatal("fsysopen: %r");
allowall = 1;
memset(&au, 0, sizeof au);

View file

@ -67,7 +67,7 @@ threadmain(int argc, char **argv)
sysfatal("diskcache: %r");
if((fsys = fsysopen(disk)) == nil)
sysfatal("ffsopen: %r");
sysfatal("fsysopen: %r");
nfs3chan = chancreate(sizeof(SunMsg*), 0);
mountchan = chancreate(sizeof(SunMsg*), 0);

View file

@ -164,7 +164,7 @@ threadmain(int argc, char **argv)
if((disk = diskcache(disk, 32768, 2*MAXQ+16)) == nil)
sysfatal("diskcache: %r");
if((fsys = fsysopen(disk)) == nil)
sysfatal("ffsopen: %r");
sysfatal("fsysopen: %r");
/*
* connect to venti

View file

@ -52,7 +52,7 @@ threadmain(int argc, char **argv)
if((disk = diskopenventi(c, score)) == nil)
sysfatal("diskopenventi: %r");
if((fsys = fsysopen(disk)) == nil)
sysfatal("ffsopen: %r");
sysfatal("fsysopen: %r");
zero = emalloc(fsys->blocksize);
fprint(2, "%d blocks total\n", fsys->nblock);

View file

@ -418,7 +418,7 @@ threadmain(int argc, char **argv)
sysfatal("diskopenventi: %r");
}
if((fsys = fsysopen(disk)) == nil)
sysfatal("ffsopen: %r");
sysfatal("fsysopen: %r");
fprint(2, "block size %d\n", fsys->blocksize);
buf = emalloc(fsys->blocksize);