Mercurial > gftp.yaz
changeset 260:71d0098c3735
2003-8-17 Brian Masney <masneyb@gftp.org>
* lib/protocols.c (parse_time) - when parsing timestamps that are not in
the current locale, skip over the proper amount of tokens. This is so
that the filename is returned properly.
* lib/misc.c (gftp_info) - show the protocols that are installed.
author | masneyb |
---|---|
date | Mon, 18 Aug 2003 00:57:57 +0000 |
parents | 2fb5ca765d85 |
children | dbf13a10be13 |
files | ChangeLog lib/misc.c lib/protocols.c |
diffstat | 3 files changed, 39 insertions(+), 14 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Thu Aug 14 20:57:21 2003 +0000 +++ b/ChangeLog Mon Aug 18 00:57:57 2003 +0000 @@ -1,3 +1,10 @@ +2003-8-17 Brian Masney <masneyb@gftp.org> + * lib/protocols.c (parse_time) - when parsing timestamps that are not in + the current locale, skip over the proper amount of tokens. This is so + that the filename is returned properly. + + * lib/misc.c (gftp_info) - show the protocols that are installed. + 2003-8-11 Brian Masney <masneyb@gftp.org> * lib/local.c (local_get_next_file) - fix for directories that are symlinks @@ -1474,7 +1481,7 @@ * cvsclean - added this script - * *.[ch] - added $Id: ChangeLog,v 1.134 2003/08/12 01:05:01 masneyb Exp $ tags + * *.[ch] - added $Id: ChangeLog,v 1.135 2003/08/18 00:57:56 masneyb Exp $ tags * debian/* - updated files from Debian maintainer
--- a/lib/misc.c Thu Aug 14 20:57:21 2003 +0000 +++ b/lib/misc.c Mon Aug 18 00:57:57 2003 +0000 @@ -352,10 +352,12 @@ static void gftp_info (void) { + int i; + printf ("%s\n", gftp_version); #ifdef _LARGEFILE_SOURCE - printf ("#define_LARGEFILE_SOURCE\n"); + printf ("#define _LARGEFILE_SOURCE\n"); #endif #ifdef _FILE_OFFSET_BITS @@ -364,10 +366,6 @@ printf ("sizeof (off_t) = %d\n", sizeof (off_t)); -#ifdef USE_SSL - printf ("#define USE_SSL\n"); -#endif - #ifdef HAVE_GETADDRINFO printf ("#define HAVE_GETADDRINFO\n"); #endif @@ -404,6 +402,13 @@ #ifdef USE_SSL printf ("OpenSSL version: 0x%lx\n", OPENSSL_VERSION_NUMBER); #endif + + printf ("Enabled protocols: "); + for (i=0; gftp_protocols[i].name != NULL; i++) + { + printf ("%s ", gftp_protocols[i].name); + } + printf ("\n"); }
--- a/lib/protocols.c Thu Aug 14 20:57:21 2003 +0000 +++ b/lib/protocols.c Mon Aug 18 00:57:57 2003 +0000 @@ -1031,18 +1031,20 @@ struct tm curtime, *loctime; time_t t, ret; char *tmppos; - int i; + int i, num; memset (&curtime, 0, sizeof (curtime)); curtime.tm_isdst = -1; - if (strlen (str) > 4 && isdigit ((int) str[0]) && str[2] == '-' && isdigit ((int) str[3])) + if (strlen (str) > 4 && isdigit ((int) str[0]) && str[2] == '-' && + isdigit ((int) str[3])) { /* This is how DOS will return the date/time */ /* 07-06-99 12:57PM */ tmppos = strptime (str, "%m-%d-%y %I:%M%p", &curtime); } - else if (strlen (str) > 4 && isdigit ((int) str[0]) && str[2] == '-' && isalpha (str[3])) + else if (strlen (str) > 4 && isdigit ((int) str[0]) && str[2] == '-' && + isalpha (str[3])) { /* 10-Jan-2003 09:14 */ tmppos = strptime (str, "%d-%h-%Y %H:%M", &curtime); @@ -1072,11 +1074,22 @@ { if (tmppos == NULL) { - /* We cannot parse this date format. So, just skip this date field and continue to the next - token. This is mainly for the HTTP support */ - - for (i=0, *endpos = str; (*endpos)[i] != ' ' && (*endpos)[i] != '\t' && (*endpos)[i] != '\0'; i++); - endpos += i; + /* We cannot parse this date format. So, just skip this date field + and continue to the next token. This is mainly for the HTTP + support */ + + *endpos = str; + for (num = 0; num < 2 && **endpos != '\0'; num++) + { + for (i=0; + (*endpos)[i] != ' ' && (*endpos)[i] != '\t' && + (*endpos)[i] != '\0'; + i++); + *endpos += i; + + for (i=0; (*endpos)[i] == ' ' || (*endpos)[i] == '\t'; i++); + *endpos += i; + } } else *endpos = tmppos;