@@ -0,0 +1,1220 @@
+--- src/CopyJob.cc
++++ src/CopyJob.cc
+@@ -21,6 +21,7 @@
+ /* $Id: CopyJob.cc,v 1.35 2006/10/10 11:54:43 lav Exp $ */
+
+ #include <config.h>
++#include <unistd.h>
+ #include "CopyJob.h"
+ #include "ArgV.h"
+ #include "plural.h"
+@@ -274,7 +275,7 @@
+
+ void CopyJobEnv::SayFinalWithPrefix(const char *p)
+ {
+- if(no_status)
++ if(no_status || !isatty(1))
+ return;
+ if(count==errors)
+ return;
+--- src/Makefile.am
++++ src/Makefile.am
+@@ -1,7 +1,7 @@
+ localedir = $(datadir)/locale
+ pkgverlibdir = $(pkglibdir)/$(VERSION)
+
+-bin_PROGRAMS = lftp
++bin_PROGRAMS = lftp lftp_wrapper
+ bin_SCRIPTS = lftpget
+ pkgdata_SCRIPTS = import-ncftp import-netscape verify-file convert-netscape-cookies
+ noinst_SCRIPTS = ftpget
+@@ -9,6 +9,7 @@
+ EXTRA_DIST = $(pkgdata_SCRIPTS) $(bin_SCRIPTS) $(noinst_SCRIPTS)
+
+ lftp_SOURCES = lftp.cc complete.h complete.cc lftp_rl.c lftp_rl.h
++lftp_wrapper_SOURCES = lftp_wrapper.c
+
+ noinst_PROGRAMS = example1 example2 example1-cmd
+ noinst_LTLIBRARIES = example-module1.la
+--- src/lftp_wrapper.c
++++ src/lftp_wrapper.c
+@@ -0,0 +1,1179 @@
++
++/***************************************************************************
++ * *
++ * Copyright (c) 2005 SUSE LINUX Products GmbH, Nuernberg, Germany *
++ * Authors: Pavel Nemec <pnemec@suse.cz> *
++ * Petr Ostadal <postadal@suse.cz> *
++ * *
++ * wrapper for ftp *
++ * this wraper should provide ftp format of comands for lftp *
++ * only noninteractive mode is implemented *
++ * *
++ ***************************************************************************/
++
++/***************************************************************************
++ * *
++ * This program is free software; you can redistribute it and/or modify *
++ * it under the terms of the GNU General Public License as published by *
++ * the Free Software Foundation; either version 2 of the License, or *
++ * (at your option) any later version. *
++ * *
++ ***************************************************************************/
++
++#include <stdlib.h>
++#include <stdio.h>
++#include <unistd.h>
++#include <stdarg.h>
++#include <string.h>
++#include <limits.h>
++#include <sys/types.h>
++#include <sys/socket.h>
++#include <netdb.h>
++#include <err.h>
++#include <ctype.h>
++
++static void help(void);
++static int strsuftoi(const char *arg);
++static void not_implemented_ignoring(char *what);
++static void add_to_e_script(char *cmd); /* at to end */
++static void add_to_e_scriptB(char *cmd); /* at to begin */
++static char *collect_strings(int argc, char **argv);
++char *get_file(char *url_with_file);
++char *get_url(char *url_with_file);
++int haveFile(char *text);
++void printPortWarningMessage(char *port);
++void printPortErrorMessage(char *url, int port);
++
++int isFile(char *url);
++int isFTP(char *url);
++int isHTML(char *url);
++int isHost(char *url);
++int locateChar(char *haystack, char needle);
++int locateCharR(char *haystack, char needle);
++char *convertClasicToFtp(char *url);
++int isWithUsername(char *url);
++int isValidPort(char *port);
++int isPortInUrl(char *url);
++void removeAnonymousUser(char *url);
++
++
++#define BUFSIZE 4096
++#define FTP_PORT 21
++
++#define INSTALLED_COMPAT_MODE_MODULE 1
++#define SSL_NOT_ALLOW 1
++
++#define ANONYMOUS_PREFIX "anonymous@"
++
++#ifdef INSTALLED_COMPAT_MODE_MODULE
++# define LFTP_OPEN "lftp-open"
++# define LFTP_COMPAT_MODE_OPEN "open"
++#else /* INSTALLED_COMPAT_MODE_MODULE */
++# define LFTP_OPEN "open"
++# define LFTP_COMPAT_MODE_OPEN "open"
++#endif /* INSTALLED_COMPAT_MODE_MODULE */
++
++static char *binname = NULL;
++static int compat_mode_warning = 1;
++static char e_script[BUFSIZE + 1];
++static char *HTML_URL = "http://";
++static char *FTP_URL = "ftp://";
++static char *FILE_URL = "file://";
++static unsigned int MAX_PORT = 65535;
++static char *std_out = "/dev/stdout";
++
++
++int main(int argc, char *argv[])
++{
++ int ch;
++ int notimplemented;
++ int anonymous = 0; /* 0 not force anonymous login, 1 force anonymous login*/
++ int debug = 0;
++ int verbose = 0; /* -1=off 0 = NA 1 =on */
++ int force_cache_reload = 0;
++ int autologin = 1;
++ char *ftp_port = NULL;
++ int ftp_port_i=FTP_PORT;
++ int retry_wait = -1;
++ char *end;
++ int restart_auto_fetching = 0; /* 0 no, 1-yes */
++ char *upload_path = NULL;
++ char *new_argv0 = "lftp";
++ char **new_argv;
++ int iarg = 0;
++ char buf[BUFSIZE + 1];
++ int rate_get = 0, rate_put = 0;
++ int rate_get_incr = -1, rate_put_incr = -1;
++ char *anonymous_pass = NULL;
++ char *env;
++ int passive_mode = -1;
++ int active_fallback = -1;
++ int interactive = 0;
++
++ /*
++ * if 0 using mput/mget, if 1 * using * put/get to supress * local
++ * file * completiotion
++ */
++ int globing = 0;
++ int showEXE = 0;
++
++ /*
++ * if 0 no redirection, if 1 redirection to file or to /dev/stdout
++ */
++ int redirect_output = 0;
++ char *output_file = NULL;
++
++ /*
++ * both in lftp and lukemftp is default mode passive, 0 means acitve
++ */
++ passive_mode = 1;
++
++ /*
++ * terminal
++ */
++ int is_tty = 0;
++ int i;
++
++
++ e_script[0] = '\0';
++
++ if (!(new_argv = (char **) malloc(sizeof(char *) * (argc + 100))))
++ return -1;
++
++ binname = strrchr(argv[0], '/');
++ if (binname == NULL)
++ binname = argv[0];
++ else
++ binname++;
++
++ if (strcmp(binname, "pftp") == 0) {
++ passive_mode = 1;
++ active_fallback = 0;
++ } else if (strcmp(binname, "gate-ftp") == 0)
++ not_implemented_ignoring("gate_mode");
++
++ /*
++ * environment compatibility
++ */
++ anonymous_pass = getenv("FTPANONPASS");
|