mirror of
git://git.gnupg.org/gnupg.git
synced 2025-03-28 22:49:59 +01:00
* g10.c (main): Enhance the version-specific config file code to try for
more specific matches before giving up (e.g. 1.3.3-cvs, 1.3.3, 1.3, 1).
This commit is contained in:
parent
bb7986e9a6
commit
ce4c9b6b5f
@ -1,3 +1,9 @@
|
|||||||
|
2003-10-26 David Shaw <dshaw@jabberwocky.com>
|
||||||
|
|
||||||
|
* g10.c (main): Enhance the version-specific config file code to
|
||||||
|
try for more specific matches before giving up (e.g. 1.3.3-cvs,
|
||||||
|
1.3.3, 1.3, 1).
|
||||||
|
|
||||||
2003-10-25 David Shaw <dshaw@jabberwocky.com>
|
2003-10-25 David Shaw <dshaw@jabberwocky.com>
|
||||||
|
|
||||||
* g10.c (main): Add --symmetric --encrypt command. This generates
|
* g10.c (main): Add --symmetric --encrypt command. This generates
|
||||||
|
34
g10/g10.c
34
g10/g10.c
@ -1299,17 +1299,37 @@ main( int argc, char **argv )
|
|||||||
|
|
||||||
set_native_charset (NULL); /* Try to auto set the character set */
|
set_native_charset (NULL); /* Try to auto set the character set */
|
||||||
|
|
||||||
|
/* Try for a version specific config file first */
|
||||||
if( default_config )
|
if( default_config )
|
||||||
{
|
{
|
||||||
/* Try for a version specific config file first */
|
char *name=m_strdup("gpg" EXTSEP_S "conf-" SAFE_VERSION);
|
||||||
configname = make_filename(opt.homedir,
|
char *ver=&name[strlen("gpg" EXTSEP_S "conf-")];
|
||||||
"gpg" EXTSEP_S "conf-" SAFE_VERSION, NULL );
|
|
||||||
if(access(configname,R_OK))
|
do
|
||||||
{
|
{
|
||||||
m_free(configname);
|
if(configname)
|
||||||
configname = make_filename(opt.homedir,
|
{
|
||||||
"gpg" EXTSEP_S "conf", NULL );
|
char *tok;
|
||||||
|
|
||||||
|
m_free(configname);
|
||||||
|
configname=NULL;
|
||||||
|
|
||||||
|
if((tok=strrchr(ver,SAFE_VERSION_DASH)))
|
||||||
|
*tok='\0';
|
||||||
|
else if((tok=strrchr(ver,SAFE_VERSION_DOT)))
|
||||||
|
*tok='\0';
|
||||||
|
else
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
configname = make_filename(opt.homedir,name,NULL);
|
||||||
}
|
}
|
||||||
|
while(access(configname,R_OK));
|
||||||
|
|
||||||
|
m_free(name);
|
||||||
|
|
||||||
|
if(!configname)
|
||||||
|
configname=make_filename(opt.homedir, "gpg" EXTSEP_S "conf", NULL );
|
||||||
if (!access (configname, R_OK))
|
if (!access (configname, R_OK))
|
||||||
{ /* Print a warning when both config files are present. */
|
{ /* Print a warning when both config files are present. */
|
||||||
char *p = make_filename(opt.homedir, "options", NULL );
|
char *p = make_filename(opt.homedir, "options", NULL );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user