Subject: NT's dummy_valid -- bug(?)

From: Carl Stehle <[email-masked]>
Date: Fri, 19 Jul 2002 10:29:25 -0700

While tracking an unrelated problem, I inadvertently discovered
that the pathname used in nt\dummynt.c dummy_valid() is incorrect.
(The strrchr changes the variable s so stat doesn't work).
Not sure where (or if) this routine is used, but here is
a trivial fix. 

None of the other platforms have dummy_valid routines which do
this, so they are unaffected.

---

DRIVER *dummy_valid (char *name)
{
  char *s,*t,tmp[MAILTMPLEN];
  struct stat sbuf;
				/* must be valid local mailbox */
  if (name && *name && (*name != '{') && (s = mailboxfile (tmp,name))) {
				/* indeterminate INBOX */
    if (!*s) return &dummydriver;
				/* remove trailing \ */
    if ((t = strrchr (s,'\\')) && !t[1]) *t = '\0';
    else if (!stat (s,&sbuf)) switch (sbuf.st_mode & S_IFMT) {
    case S_IFREG:		/* file */
    case S_IFDIR:		/* future use */
      return &dummydriver;
    }
  }
  return NIL;
}

---

Regards,
Carl Stehle
-- 
------------------------------------------------------------------
 For information about this mailing list, and its archives, see: 
 http://www.washington.edu/imap/c-client-list.html
------------------------------------------------------------------