head 1.4; access; symbols pkgsrc-2026Q1:1.4.0.160 pkgsrc-2026Q1-base:1.4 pkgsrc-2025Q4:1.4.0.158 pkgsrc-2025Q4-base:1.4 pkgsrc-2025Q3:1.4.0.156 pkgsrc-2025Q3-base:1.4 pkgsrc-2025Q2:1.4.0.154 pkgsrc-2025Q2-base:1.4 pkgsrc-2025Q1:1.4.0.152 pkgsrc-2025Q1-base:1.4 pkgsrc-2024Q4:1.4.0.150 pkgsrc-2024Q4-base:1.4 pkgsrc-2024Q3:1.4.0.148 pkgsrc-2024Q3-base:1.4 pkgsrc-2024Q2:1.4.0.146 pkgsrc-2024Q2-base:1.4 pkgsrc-2024Q1:1.4.0.144 pkgsrc-2024Q1-base:1.4 pkgsrc-2023Q4:1.4.0.142 pkgsrc-2023Q4-base:1.4 pkgsrc-2023Q3:1.4.0.140 pkgsrc-2023Q3-base:1.4 pkgsrc-2023Q2:1.4.0.138 pkgsrc-2023Q2-base:1.4 pkgsrc-2023Q1:1.4.0.136 pkgsrc-2023Q1-base:1.4 pkgsrc-2022Q4:1.4.0.134 pkgsrc-2022Q4-base:1.4 pkgsrc-2022Q3:1.4.0.132 pkgsrc-2022Q3-base:1.4 pkgsrc-2022Q2:1.4.0.130 pkgsrc-2022Q2-base:1.4 pkgsrc-2022Q1:1.4.0.128 pkgsrc-2022Q1-base:1.4 pkgsrc-2021Q4:1.4.0.126 pkgsrc-2021Q4-base:1.4 pkgsrc-2021Q3:1.4.0.124 pkgsrc-2021Q3-base:1.4 pkgsrc-2021Q2:1.4.0.122 pkgsrc-2021Q2-base:1.4 pkgsrc-2021Q1:1.4.0.120 pkgsrc-2021Q1-base:1.4 pkgsrc-2020Q4:1.4.0.118 pkgsrc-2020Q4-base:1.4 pkgsrc-2020Q3:1.4.0.116 pkgsrc-2020Q3-base:1.4 pkgsrc-2020Q2:1.4.0.112 pkgsrc-2020Q2-base:1.4 pkgsrc-2020Q1:1.4.0.92 pkgsrc-2020Q1-base:1.4 pkgsrc-2019Q4:1.4.0.114 pkgsrc-2019Q4-base:1.4 pkgsrc-2019Q3:1.4.0.110 pkgsrc-2019Q3-base:1.4 pkgsrc-2019Q2:1.4.0.108 pkgsrc-2019Q2-base:1.4 pkgsrc-2019Q1:1.4.0.106 pkgsrc-2019Q1-base:1.4 pkgsrc-2018Q4:1.4.0.104 pkgsrc-2018Q4-base:1.4 pkgsrc-2018Q3:1.4.0.102 pkgsrc-2018Q3-base:1.4 pkgsrc-2018Q2:1.4.0.100 pkgsrc-2018Q2-base:1.4 pkgsrc-2018Q1:1.4.0.98 pkgsrc-2018Q1-base:1.4 pkgsrc-2017Q4:1.4.0.96 pkgsrc-2017Q4-base:1.4 pkgsrc-2017Q3:1.4.0.94 pkgsrc-2017Q3-base:1.4 pkgsrc-2017Q2:1.4.0.90 pkgsrc-2017Q2-base:1.4 pkgsrc-2017Q1:1.4.0.88 pkgsrc-2017Q1-base:1.4 pkgsrc-2016Q4:1.4.0.86 pkgsrc-2016Q4-base:1.4 pkgsrc-2016Q3:1.4.0.84 pkgsrc-2016Q3-base:1.4 pkgsrc-2016Q2:1.4.0.82 pkgsrc-2016Q2-base:1.4 pkgsrc-2016Q1:1.4.0.80 pkgsrc-2016Q1-base:1.4 pkgsrc-2015Q4:1.4.0.78 pkgsrc-2015Q4-base:1.4 pkgsrc-2015Q3:1.4.0.76 pkgsrc-2015Q3-base:1.4 pkgsrc-2015Q2:1.4.0.74 pkgsrc-2015Q2-base:1.4 pkgsrc-2015Q1:1.4.0.72 pkgsrc-2015Q1-base:1.4 pkgsrc-2014Q4:1.4.0.70 pkgsrc-2014Q4-base:1.4 pkgsrc-2014Q3:1.4.0.68 pkgsrc-2014Q3-base:1.4 pkgsrc-2014Q2:1.4.0.66 pkgsrc-2014Q2-base:1.4 pkgsrc-2014Q1:1.4.0.64 pkgsrc-2014Q1-base:1.4 pkgsrc-2013Q4:1.4.0.62 pkgsrc-2013Q4-base:1.4 pkgsrc-2013Q3:1.4.0.60 pkgsrc-2013Q3-base:1.4 pkgsrc-2013Q2:1.4.0.58 pkgsrc-2013Q2-base:1.4 pkgsrc-2013Q1:1.4.0.56 pkgsrc-2013Q1-base:1.4 pkgsrc-2012Q4:1.4.0.54 pkgsrc-2012Q4-base:1.4 pkgsrc-2012Q3:1.4.0.52 pkgsrc-2012Q3-base:1.4 pkgsrc-2012Q2:1.4.0.50 pkgsrc-2012Q2-base:1.4 pkgsrc-2012Q1:1.4.0.48 pkgsrc-2012Q1-base:1.4 pkgsrc-2011Q4:1.4.0.46 pkgsrc-2011Q4-base:1.4 pkgsrc-2011Q3:1.4.0.44 pkgsrc-2011Q3-base:1.4 pkgsrc-2011Q2:1.4.0.42 pkgsrc-2011Q2-base:1.4 pkgsrc-2011Q1:1.4.0.40 pkgsrc-2011Q1-base:1.4 pkgsrc-2010Q4:1.4.0.38 pkgsrc-2010Q4-base:1.4 pkgsrc-2010Q3:1.4.0.36 pkgsrc-2010Q3-base:1.4 pkgsrc-2010Q2:1.4.0.34 pkgsrc-2010Q2-base:1.4 pkgsrc-2010Q1:1.4.0.32 pkgsrc-2010Q1-base:1.4 pkgsrc-2009Q4:1.4.0.30 pkgsrc-2009Q4-base:1.4 pkgsrc-2009Q3:1.4.0.28 pkgsrc-2009Q3-base:1.4 pkgsrc-2009Q2:1.4.0.26 pkgsrc-2009Q2-base:1.4 pkgsrc-2009Q1:1.4.0.24 pkgsrc-2009Q1-base:1.4 pkgsrc-2008Q4:1.4.0.22 pkgsrc-2008Q4-base:1.4 pkgsrc-2008Q3:1.4.0.20 pkgsrc-2008Q3-base:1.4 cube-native-xorg:1.4.0.18 cube-native-xorg-base:1.4 pkgsrc-2008Q2:1.4.0.16 pkgsrc-2008Q2-base:1.4 cwrapper:1.4.0.14 pkgsrc-2008Q1:1.4.0.12 pkgsrc-2008Q1-base:1.4 pkgsrc-2007Q4:1.4.0.10 pkgsrc-2007Q4-base:1.4 pkgsrc-2007Q3:1.4.0.8 pkgsrc-2007Q3-base:1.4 pkgsrc-2007Q2:1.4.0.6 pkgsrc-2007Q2-base:1.4 pkgsrc-2007Q1:1.4.0.4 pkgsrc-2007Q1-base:1.4 pkgsrc-2006Q4:1.4.0.2 pkgsrc-2006Q4-base:1.4 pkgsrc-2006Q3:1.3.0.6 pkgsrc-2006Q3-base:1.3 pkgsrc-2006Q2:1.3.0.4 pkgsrc-2006Q2-base:1.3 pkgsrc-2006Q1:1.3.0.2 pkgsrc-2006Q1-base:1.3 pkgsrc-2005Q4:1.2.0.26 pkgsrc-2005Q4-base:1.2 pkgsrc-2005Q3:1.2.0.24 pkgsrc-2005Q3-base:1.2 pkgsrc-2005Q2:1.2.0.22 pkgsrc-2005Q2-base:1.2 pkgsrc-2005Q1:1.2.0.20 pkgsrc-2005Q1-base:1.2 pkgsrc-2004Q4:1.2.0.18 pkgsrc-2004Q4-base:1.2 pkgsrc-2004Q3:1.2.0.16 pkgsrc-2004Q3-base:1.2 pkgsrc-2004Q2:1.2.0.14 pkgsrc-2004Q2-base:1.2 pkgsrc-2004Q1:1.2.0.12 pkgsrc-2004Q1-base:1.2 pkgsrc-2003Q4:1.2.0.10 pkgsrc-2003Q4-base:1.2 netbsd-1-6-1:1.2.0.6 netbsd-1-6-1-base:1.2 netbsd-1-6:1.2.0.8 netbsd-1-6-RELEASE-base:1.2 pkgviews:1.2.0.4 pkgviews-base:1.2 buildlink2:1.2.0.2 buildlink2-base:1.2 netbsd-1-5-PATCH003:1.2 netbsd-1-5-PATCH001:1.2 netbsd-1-5-RELEASE:1.1.1.1 netbsd-1-4-PATCH003:1.1.1.1 netbsd-1-4-PATCH002:1.1.1.1 comdex-fall-1999:1.1.1.1 netbsd-1-4-PATCH001:1.1.1.1 pkgsrc-base:1.1.1.1 TNF:1.1.1; locks; strict; comment @# @; 1.4 date 2006.12.18.22.46.53; author rillig; state Exp; branches; next 1.3; 1.3 date 2006.01.12.13.28.57; author joerg; state Exp; branches; next 1.2; 1.2 date 2000.12.28.00.03.20; author wiz; state Exp; branches; next 1.1; 1.1 date 99.05.30.21.34.39; author tron; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 99.05.30.21.34.39; author tron; state Exp; branches; next ; desc @@ 1.4 log @Fixed all gcc warnings to make batchftp compile again on NetBSD. @ text @$NetBSD: patch-aa,v 1.3 2006/01/12 13:28:57 joerg Exp $ --- batchftp.c.orig 1990-10-23 21:12:42.000000000 +0100 +++ batchftp.c 2006-12-18 23:44:29.000000000 +0100 @@@@ -5,10 +5,16 @@@@ requests, and execute all other ftp commands. A user has the option to run the program in either the background or the foreground. */ +#include + #define _DIR_PATH 200 /* directory path name length -- can be set to MAXPATHNAMELEN */ #define _NULL 0 #define _HOSTLEN MAXHOSTNAMELEN + 80 /* local hostname + domain + network */ +#if defined(NAME_MAX) +#define _PATHLEN _DIR_PATH + NAME_MAX /* file path length -- directory + filename */ +#else #define _PATHLEN _DIR_PATH + MAXNAMLEN /* file path length -- directory + filename */ +#endif #define _TRUE 1 #define _FALSE 0 @@@@ -47,7 +53,8 @@@@ #include #include #include -#include +#include +#include #include #include @@@@ -60,16 +67,18 @@@@ #include #include +#include +#include + +static void init_sh_script(char *, char *, char *); +static void init_fscript (char *, char *, char *, FILE **); +static void start_session (FILE **, char *, char *, char *, char *); typedef char boolean; /* All string functions used in Batchftp are user-defined */ -char *strcpy (); -int strlen (); -int strncmp (); char *substr (); -char *strcat (); int strpos (); int process_entry (); @@@@ -95,12 +104,17 @@@@ int h_errno; an error such as "multiply defined variable during compilation or linking, delete the above declaration. */ +int main (argc, argv) int argc; char *argv[]; { char msgfile[_PATHLEN]; /* file containing output for all ftp transfer sessions */ +#if defined(NAME_MAX) + char ftp_script[NAME_MAX + 1]; /* file containing ftp commands */ +#else char ftp_script[MAXNAMLEN + 1]; /* file containing ftp commands */ +#endif char user_name[_LOGIN_LENGTH + 1]; /* user's login name */ char pass_word[_PASS_LENGTH + 1]; /* password used for ftp login */ char local_dir[_DIR_PATH]; /* local directory for ftp session */ @@@@ -108,8 +122,13 @@@@ char *argv[]; char remote_dir[_DIR_PATH]; /* remote directory for ftp session */ char input_file[_PATHLEN]; /* user supplied file containing ftp commands and/or shorthand notation */ char remote_host[_HOSTLEN]; /* remote hostname */ +#if defined(NAME_MAX) + char f_stdout[NAME_MAX + 1]; /* file containing output for a single transfer session */ + char sh_name[NAME_MAX + 1]; /* name of exec'd sh script -- 1 line ftp command */ +#else char f_stdout[MAXNAMLEN + 1]; /* file containing output for a single transfer session */ char sh_name[MAXNAMLEN + 1]; /* name of exec'd sh script -- 1 line ftp command */ +#endif char linebuf[_LBUF]; /* one line of user's input file */ boolean start_flag = _FALSE; /* indicates whether ftp attempt should begin */ @@@@ -129,7 +148,7 @@@@ char *argv[]; parent_pid = (int) getpid(); /* sprintf does not always support type "long" */ - getwd(home_dir); + getcwd(home_dir,sizeof(home_dir)); sprintf(msgfile, "%s/msg%d",home_dir, parent_pid); /*construct full pathname for ftp output file */ /* Parse command line switches and assign other arguments */ @@@@ -242,7 +261,7 @@@@ char *remote_host; /* extern int h_errno is global flag defined in */ strcpy(temp_host, remote_host); - if (inet_addr(remote_host) != -1) /* check for valid Internet address */ + if (inet_addr(remote_host) != INADDR_NONE) /* check for valid Internet address */ return(remote_host); do { @@@@ -307,6 +326,7 @@@@ char *local_host; the responsibility of the user to enter the proper login information in the input file (free-form mode). */ +static void init_fscript (remote_host, user_name, pass_word, fptr) char *remote_host; char *user_name; @@@@ -353,6 +373,7 @@@@ char *s; /* Init_sh_script creates the one line (not including interpreter) Bourne shell script to be exec'd during the ftp session. */ +static void init_sh_script(f_stdout, ftp_script, sh_name) char *f_stdout; char *ftp_script; @@@@ -716,6 +737,7 @@@@ int *address_flag; ftp command are killed simultaneously. Otherwise, the child is not signalled, and it will terminate naturally. */ +static void start_ftp (mptr, f_stdout, sh_name, alarm_flag, ftp_script) FILE **mptr; char *f_stdout; @@@@ -729,7 +751,7 @@@@ char *ftp_script; FILE *fs_ptr; /* pointer to f_stdout */ FILE *msg_ptr; /* pointer to ftp output file */ int monitor_flag; /* return value of monitor_ftp () */ - union wait status; /* wait for child to terminate */ + int status; /* wait for child to terminate */ char *sh_args[3]; /* arguments for execv */ *alarm_flag = _FALSE; /* alarm has not been called */ @@@@ -755,7 +777,7 @@@@ char *ftp_script; sh_args[1] = sh_name; sh_args[2] = 0; - if ((int) signal(SIGALRM, alarm_handler) == -1) { + if (signal(SIGALRM, alarm_handler) == (void *)-1) { fprintf(*mptr, "\nSYSTEM ERROR -- Unable to establish timer"); return; } @@@@ -944,6 +966,7 @@@@ unsigned sleep_time; reset. Start_session will not terminate until check_ftp() returns a value other than -1 */ +static void start_session (mptr, f_stdout, sh_name, ftp_script, msgfile) FILE **mptr; char *f_stdout; @@@@ -958,6 +981,7 @@@@ char *msgfile; int monitor_flag; /* return value of monitor_ftp () */ int check_flag; /* return value of check_ftp () */ + check_flag = 0; /* XXX: gcc */ do { msg_ptr = *mptr; sleep_time = connect_delay(sleep_time); @@@@ -986,69 +1010,6 @@@@ char *msgfile; } /*------------------------------------------------------- */ -int strlen (s) - -register char *s; -{ - register int n = 0; - - while (*s++) - ++n; - - return (n); -} -/* -------------------------------------------------- */ - -int strncmp (s1, s2, n) - -register char *s1, *s2; -register int n; -{ - if (n < 1) - return (_INVARG); - - { - register int char_count = -1; - - while ((++char_count < n) && (*s1) && (*s2)) { - if (*s1 > *s2) - return (_GREATER); - - if (*s1++ < *s2++) - return (_LESS); - } - - if (char_count == n) - return (_EQUAL); - - - if (*s1 > *s2) - return (_GREATER); - - if (*s1 < *s2) - return (_LESS); - - } - - return (_EQUAL); -} - -/*--------------------------------------------------- */ - -char *strcpy (s1, s2) - -register char *s1, *s2; -{ - - register char *ptr; - - ptr = s1; - while (*ptr++ = *s2++) - ; - - return (s1); -} -/*---------------------------------------------------------- */ char *substr (s1, s2) register char *s1, *s2; @@@@ -1068,20 +1029,6 @@@@ register char *s1, *s2; } /* -------------------------------------------------- */ -char *strcat (s1, s2) - -register char *s1, *s2; -{ - register char *p; - - p = s1; - while (*p++) - ; - - --p; - strcpy (p, s2); - return (s1); -} /*--------------------------------------------------------- */ int strpos (s, c) @ 1.3 log @Prefer NAME_MAX over MAXNAMLEN, don't implement libc string functions locally. Use dirent.h insteaf of sys/dir.h. Bump revision. @ text @d1 1 a1 1 $NetBSD$ d3 2 a4 2 --- batchftp.c.orig 1990-10-23 20:12:42.000000000 +0000 +++ batchftp.c d32 12 a43 1 @@@@ -65,11 +72,7 @@@@ typedef char boolean; d55 7 a61 1 @@@@ -100,7 +103,11 @@@@ int argc; d73 1 a73 1 @@@@ -108,8 +115,13 @@@@ char *argv[]; d87 1 a87 1 @@@@ -129,7 +141,7 @@@@ char *argv[]; d96 34 a129 1 @@@@ -729,7 +741,7 @@@@ char *ftp_script; d138 1 a138 1 @@@@ -755,7 +767,7 @@@@ char *ftp_script; d147 17 a163 1 @@@@ -986,69 +998,6 @@@@ char *msgfile; d233 1 a233 1 @@@@ -1068,20 +1017,6 @@@@ register char *s1, *s2; @ 1.2 log @Fix compilation on alpha. @ text @d3 1 a3 1 --- batchftp.c.orig Tue Oct 23 21:12:42 1990 d5 29 a33 1 @@@@ -66,7 +66,7 @@@@ d36 1 a36 1 char *strcpy (); d38 1 a38 2 +size_t strlen (); int strncmp (); d40 31 a70 2 char *strcat (); @@@@ -129,7 +129,7 @@@@ d79 1 a79 1 @@@@ -729,7 +729,7 @@@@ d88 1 a88 1 @@@@ -755,7 +755,7 @@@@ d97 1 a97 1 @@@@ -986,7 +986,7 @@@@ d102 63 a164 1 +size_t strlen (s) d166 22 a187 2 register char *s; { @ 1.1 log @Initial revision @ text @d4 10 a13 1 +++ batchftp.c Sun May 30 23:20:33 1999 d32 18 @ 1.1.1.1 log @Import new "batchftp" package: Automatically download files via the FTP protocoll. @ text @@