Hello community,
here is the log from the commit of package vrfy
checked in at Mon Jul 10 17:24:46 CEST 2006.
--------
--- vrfy/vrfy.changes 2006-01-25 21:42:43.000000000 +0100
+++ vrfy/vrfy.changes 2006-07-10 14:23:11.000000000 +0200
@@ -1,0 +2,6 @@
+Mon Jul 10 14:19:17 CEST 2006 - anicka@suse.cz
+
+- rewrite functions with optional arguments, fixes [#188991]
+- use strerror instead of errlist
+
+-------------------------------------------------------------------
New:
----
vrfy_990522-strerror.diff
vrfy_990522-varargs.diff
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ vrfy.spec ++++++
--- /var/tmp/diff_new_pack.AvR69m/_old 2006-07-10 17:23:50.000000000 +0200
+++ /var/tmp/diff_new_pack.AvR69m/_new 2006-07-10 17:23:50.000000000 +0200
@@ -5,7 +5,7 @@
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
-# Please submit bugfixes or comments via http://bugs.opensuse.org
+# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
@@ -14,9 +14,11 @@
Group: Productivity/Networking/Email/Utilities
Autoreqprov: on
Version: 990522
-Release: 443
+Release: 454
Source: %{name}_%{version}.tar.bz2
Patch0: %{name}_%{version}-makefile.patch
+Patch1: %{name}_%{version}-varargs.diff
+Patch2: %{name}_%{version}-strerror.diff
URL: http://www.nikhef.nl/user/e07
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Summary: Tool to verify e-mail addresses and mailing lists
@@ -37,7 +39,8 @@
%prep
%setup -c -n %{name}_%{version}
%patch0
-
+%patch1
+%patch2
%build
make COPTS="$RPM_OPT_FLAGS"
@@ -58,6 +61,9 @@
/usr/bin/*
%changelog -n vrfy
+* Mon Jul 10 2006 - anicka@suse.cz
+- rewrite functions with optional arguments, fixes [#188991]
+- use strerror instead of errlist
* Wed Jan 25 2006 - mls@suse.de
- converted neededforbuild to BuildRequires
* Sun Jan 15 2006 - schwab@suse.de
++++++ vrfy_990522-strerror.diff ++++++
--- port.h
+++ port.h
@@ -37,18 +37,6 @@
#endif
/*
-** Special definitions for certain platforms.
-*/
-
-#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
-#define ERRLIST_DEFINED /* don't declare sys_errlist */
-#endif
-
-#if defined(linux) || defined(__bsdi__)
-#define ERRLIST_DEFINED /* don't declare sys_errlist */
-#endif
-
-/*
** Distinguish between various BIND releases.
*/
--- stat.c
+++ stat.c
@@ -24,11 +24,6 @@
#include "vrfy.h"
-#if !defined(ERRLIST_DEFINED)
-extern char *sys_errlist[];
-extern int sys_nerr;
-#endif
-
extern int SmtpErrno; /* saved errno from system calls */
extern char *SmtpPhase; /* connection state message */
extern char *CurHostName; /* remote host that is being contacted */
@@ -117,7 +112,7 @@
if (err == ECONNRESET)
(void) strcpy(buf, "Connection reset");
else
- (void) strcpy(buf, sys_errlist[err]);
+ (void) strcpy(buf, strerror(err));
if (SmtpPhase != NULL)
{
(void) strcat(buf, " during ");
@@ -146,11 +141,7 @@
return(buf);
}
- if (err > 0 && err < sys_nerr)
- return((char *)sys_errlist[err]);
-
- (void) sprintf(buf, "Error %d", err);
- return(buf);
+ return strerror(err);
}
/*
--- vrfy.h
+++ vrfy.h
@@ -16,6 +16,7 @@
#include
#include
#include
+#include
#include
#include
++++++ vrfy_990522-varargs.diff ++++++
--- defs.h
+++ defs.h
@@ -4,6 +4,8 @@
** @(#)defs.h e07@nikhef.nl (Eric Wassenaar) 971114
*/
+#include
+
/*
** Internal declarations of the vrfy utility
** -----------------------------------------
@@ -17,6 +19,7 @@
void error PROTO((char *, ...));
void usrerr PROTO((char *, ...));
void message PROTO((char *, ...));
+void vmessage PROTO((char *, va_list args));
void response PROTO((char *));
void show PROTO((int, char *));
void loop PROTO((char *, char *));
@@ -69,7 +72,7 @@
sigtype_t timer PROTO((int));
char *sfgets PROTO((char *, int, FILE *));
-int makeconnection PROTO((char *, char **, char **));
+int makeconnection PROTO((char *, FILE **, FILE **));
void setmyhostname PROTO((void));
int getmyhostname PROTO((char *));
bool internet PROTO((char *));
--- main.c
+++ main.c
@@ -589,13 +589,13 @@
*/
void
-/*VARARGS1*/
-fatal(fmt, a, b, c, d)
-char *fmt; /* format of message */
-char *a, *b, *c, *d; /* optional arguments */
+fatal(char *fmt, ...)
{
- (void) fprintf(stderr, fmt, a, b, c, d);
+ va_list args;
+ va_start(args, fmt);
+ (void) vfprintf(stderr, fmt, args);
(void) fprintf(stderr, "\n");
+ va_end(args);
exit(EX_USAGE);
}
@@ -608,13 +608,14 @@
** None.
*/
-void /*VARARGS1*/
-error(fmt, a, b, c, d)
-char *fmt; /* format of message */
-char *a, *b, *c, *d; /* optional arguments */
+void
+error(char *fmt, ...)
{
- (void) fprintf(stderr, fmt, a, b, c, d);
+ va_list args;
+ va_start(args, fmt);
+ (void) vfprintf(stderr, fmt, args);
(void) fprintf(stderr, "\n");
+ va_end(args);
}
/*
@@ -629,20 +630,20 @@
*/
void
-/*VARARGS1*/
-usrerr(fmt, a, b, c, d)
-char *fmt; /* format of message */
-char *a, *b, *c, *d; /* optional arguments */
+usrerr(char *fmt, ...)
{
char msg[BUFSIZ]; /* status message buffer */
+ va_list args;
/* suppress message if requested */
if (SuprErrs)
return;
/* issue message with fatal error status */
- (void) sprintf(msg, "554 %s", fmt);
- message(msg, a, b, c, d);
+ va_start(args, fmt);
+ sprintf(msg, "554 %s", fmt);
+ vmessage(msg, args);
+ va_end(args);
}
/*
@@ -656,10 +657,7 @@
*/
void
-/*VARARGS1*/
-message(msg, a, b, c, d)
-char *msg; /* status message */
-char *a, *b, *c, *d; /* optional arguments */
+vmessage(char *msg, va_list args)
{
char *fmt = &msg[4]; /* format of actual message */
@@ -676,10 +674,19 @@
printf("%s ... ", printable(AddrSpec));
/* print message itself */
- printf(fmt, a, b, c, d);
+ vprintf(fmt, args);
printf("\n");
}
+ void
+ message(char *msg, ...)
+ {
+ va_list args;
+ va_start(args, msg);
+ vmessage(msg, args);
+ va_end(args);
+ }
+
/*
** RESPONSE -- Process reply message from smtp vrfy request
** --------------------------------------------------------
--- port.h
+++ port.h
@@ -159,12 +159,10 @@
** No prototypes yet.
*/
-#define PROTO(TYPES) ()
-
#if !defined(__STDC__) || defined(apollo)
-#define Proto(TYPES) ()
+#define PROTO(TYPES) ()
#else
-#define Proto(TYPES) TYPES
+#define PROTO(TYPES) TYPES
#endif
#if !defined(__STDC__) || defined(apollo)
--- smtp.c
+++ smtp.c
@@ -593,14 +593,14 @@
void
/*VARARGS1*/
-smtpmessage(fmt, a, b, c, d)
-char *fmt; /* format of message */
-char *a, *b, *c, *d; /* optional arguments */
+smtpmessage(char *fmt, ...)
{
+ va_list args;
+ va_start(args, fmt);
if (SmtpOut != NULL)
{
/* construct the output message */
- (void) sprintf(SmtpMsgBuffer, fmt, a, b, c, d);
+ vsprintf(SmtpMsgBuffer, fmt, args);
/* display the output in verbose mode */
if (verbose >= 2 || debug)
@@ -609,6 +609,7 @@
/* send the message over the channel */
(void) fprintf(SmtpOut, "%s%s", SmtpMsgBuffer, SmtpCrLf);
}
+ va_end(args);
}
/*
--- vrfy.h
+++ vrfy.h
@@ -11,6 +11,8 @@
#undef obsolete /* old code left as a reminder */
#undef notyet /* new code for possible future use */
+#define BUFSIZ 4096 /* pray it's safe... */
+
#include
#include
#include
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit-unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit-help@opensuse.org