Invoke set_program_name() in main() functions to make gnulib happy.

This commit is contained in:
Peter Simons 2010-02-24 17:13:51 +01:00
parent b7fdc3911f
commit 954a849ff9
5 changed files with 13 additions and 4 deletions

View File

@ -8,7 +8,7 @@ else
gnulibtool=gnulib-tool gnulibtool=gnulib-tool
fi fi
gnulib_modules=( git-version-gen gitlog-to-changelog gnupload gnulib_modules=( git-version-gen gitlog-to-changelog gnupload progname
maintainer-makefile announce-gen crypto/md5 ) maintainer-makefile announce-gen crypto/md5 )
$gnulibtool --m4-base build-aux --source-base libgnu --import "${gnulib_modules[@]}" $gnulibtool --m4-base build-aux --source-base libgnu --import "${gnulib_modules[@]}"

View File

@ -4,6 +4,7 @@
* $Date$ * $Date$
*/ */
#include <progname.h>
#include "argv.h" #include "argv.h"
int int
@ -25,6 +26,8 @@ main(int argc, char ** argv)
}; };
unsigned int i; unsigned int i;
set_program_name(argv[0]);
/* Parse the command line. */ /* Parse the command line. */
argv_help_string = "You need help with a test program?"; argv_help_string = "You need help with a test program?";

View File

@ -5,12 +5,12 @@ AM_LFLAGS = -i
noinst_LIBRARIES = librfc822.a noinst_LIBRARIES = librfc822.a
noinst_HEADERS = rfc822.h noinst_HEADERS = rfc822.h
librfc822_a_SOURCES = \ librfc822_a_SOURCES = address.y address_scan.l address_sep.c decomment.c
address.y address_scan.l address_sep.c decomment.c
noinst_PROGRAMS = test noinst_PROGRAMS = test
test_SOURCES = test.c ../libmpools/mpools.c ../liblists/lists.c test_SOURCES = test.c ../libmpools/mpools.c ../liblists/lists.c
test_LDADD = librfc822.a test_CPPFLAGS = -I${srcdir}/../libgnu
test_LDADD = librfc822.a ../libgnu/libgnu.a
EXTRA_DIST = testaddresslines parse_address.c EXTRA_DIST = testaddresslines parse_address.c

View File

@ -22,6 +22,7 @@
#ifdef DEBUG_DMALLOC #ifdef DEBUG_DMALLOC
# include <dmalloc.h> # include <dmalloc.h>
#endif #endif
#include <progname.h>
#include "rfc822.h" #include "rfc822.h"
@ -36,6 +37,8 @@ main(int argc, char ** argv)
* host; * host;
int rc; int rc;
set_program_name(argv[0]);
while(gets(buffer)) { while(gets(buffer)) {
printf("Read line: '%s'\n", buffer); printf("Read line: '%s'\n", buffer);

3
main.c
View File

@ -26,6 +26,7 @@
#include "libargv/argv.h" #include "libargv/argv.h"
#include "libtext/text.h" #include "libtext/text.h"
#include "petidomo.h" #include "petidomo.h"
#include "progname.h"
#ifndef LOG_PERROR #ifndef LOG_PERROR
# define LOG_PERROR 0 # define LOG_PERROR 0
@ -51,6 +52,8 @@ main(int argc, char * argv[])
{ARGV_LAST} {ARGV_LAST}
}; };
set_program_name(argv[0]);
/* Init logging routines first of all, so that we can report /* Init logging routines first of all, so that we can report
errors. */ errors. */