From d9b3dc000085007bdd198ca4c0500e80a72475d7 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Thu, 11 Jun 1998 07:16:50 +0000 Subject: update from tobold --- util/ChangeLog | 6 ++++++ util/Makefile.in | 2 -- util/argparse.c | 7 +++++-- util/fileutil.c | 14 ++++++++++++++ 4 files changed, 25 insertions(+), 4 deletions(-) (limited to 'util') diff --git a/util/ChangeLog b/util/ChangeLog index a62ba84db..b2a1d21b7 100644 --- a/util/ChangeLog +++ b/util/ChangeLog @@ -1,3 +1,9 @@ +Wed Jun 10 07:39:41 1998 Werner Koch,mobil,,, (wk@tobold) + + * fileutil.c (compare_filenames): New. + + * argparse.c (arg_parse): New flag bit 6 to ignore --version + Thu May 14 16:45:13 1998 Werner Koch (wk@isil.d.shuttle.de) * argparse.c (show_help): Add some formatting stuff diff --git a/util/Makefile.in b/util/Makefile.in index 025ea3f8e..5e50aabcf 100644 --- a/util/Makefile.in +++ b/util/Makefile.in @@ -64,8 +64,6 @@ target_triplet = @target@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ -CIPHER_EXTRA_DIST = @CIPHER_EXTRA_DIST@ -CIPHER_EXTRA_OBJS = @CIPHER_EXTRA_OBJS@ CPP = @CPP@ DATADIRNAME = @DATADIRNAME@ G10_LOCALEDIR = @G10_LOCALEDIR@ diff --git a/util/argparse.c b/util/argparse.c index ce1dbc6af..9a9909e30 100644 --- a/util/argparse.c +++ b/util/argparse.c @@ -72,6 +72,7 @@ * Bit 3 : Do not use -- to stop option processing. * Bit 4 : Do not skip the first arg. * Bit 5 : allow usage of long option with only one dash + * Bit 6 : ignore --version * all other bits must be set to zero, this value is modified by the function * so assume this is write only. * Local flags (for each option): @@ -377,8 +378,10 @@ arg_parse( ARGPARSE_ARGS *arg, ARGPARSE_OPTS *opts) if( !opts[i].short_opt && !strcmp( "help", s+2) ) show_help(opts, arg->flags); else if( !opts[i].short_opt && !strcmp( "version", s+2) ) { - show_version(); - exit(0); + if( !(arg->flags & (1<<6)) ) { + show_version(); + exit(0); + } } else if( !opts[i].short_opt && !strcmp( "warranty", s+2) ) { puts( strusage(16) ); diff --git a/util/fileutil.c b/util/fileutil.c index 88c84ecff..2cedf0f9e 100644 --- a/util/fileutil.c +++ b/util/fileutil.c @@ -65,6 +65,20 @@ make_filename( const char *first_part, ... ) } +int +compare_filenames( const char *a, const char *b ) +{ + /* ? check whether this is an absolute filename and + * resolve symlinks? + */ + #ifdef __MINGW32__ + return stricmp(a,b); + #else + return strcmp(a,b); + #endif +} + + /**************** * A simple function to decide whether the filename is stdout * or a real filename. -- cgit v1.2.3