Re: < ftp-problem with windows-nt ftpserver >

From: <carson@dont-contact.us>
Date: Thu, 1 Aug 1996 11:36:46 -0400

It looks like _somebody_ needs to remember that sscanf() returns success on
success, unlike strcasecmp().

Try this:

*** ftpget.c.orig Thu Aug 1 11:35:16 1996
--- ftpget.c Thu Aug 1 11:32:52 1996
***************
*** 1818,1825 ****
  
      /* try it as a DOS listing */
      if (n_tokens > 3 && p->name == NULL &&
! !sscanf(tokens[0], "%[-0-9]", sbuf) && /* 04-05-70 */
! !sscanf(tokens[1], "%[0-9:apm]", sbuf)) { /* 09:33pm */
        if (!strcasecmp(tokens[2], "<dir>")) {
            p->type = 'd';
            sprintf(sbuf, "%s %s", tokens[0], tokens[1]);
--- 1818,1825 ----
  
      /* try it as a DOS listing */
      if (n_tokens > 3 && p->name == NULL &&
! sscanf(tokens[0], "%[-0-9]", sbuf) && /* 04-05-70 */
! sscanf(tokens[1], "%[0-9:apm]", sbuf)) { /* 09:33pm */
        if (!strcasecmp(tokens[2], "<dir>")) {
            p->type = 'd';
            sprintf(sbuf, "%s %s", tokens[0], tokens[1]);

--
Carson Gaspar -- carson@cs.columbia.edu carson@lehman.com
http://www.cs.columbia.edu/~carson/home.html
<This is the boring business .sig - no outre sayings here>
Received on Thu Aug 01 1996 - 09:07:53 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:32:45 MST