From: Harlan Stenn Date: Mon, 10 Sep 2007 05:57:20 +0000 (-0400) Subject: [Bug 902] Fix problems with the -6 flag X-Git-Tag: NTP_4_2_5P74~2^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f9b6279bd401f7aa836949312a3ff2c3b4391ffb;p=thirdparty%2Fntp.git [Bug 902] Fix problems with the -6 flag bk: 46e4dcc09d9lJO72n1BB3KXVWdP_kA --- diff --git a/ChangeLog b/ChangeLog index 7a9fe0a90..77468becc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,4 @@ +* [Bug 902] Fix problems with the -6 flag. * Updated include/copyright.def (owner and year). * [Bug 878] Avoid ntpdc use of refid value as unterminated string. * [Bug 881] Corrected display of pll offset on 64bit systems. diff --git a/libopts/save.c b/libopts/save.c index 22b088803..c88952075 100644 --- a/libopts/save.c +++ b/libopts/save.c @@ -437,8 +437,17 @@ optionSaveFile( tOptions* pOpts ) * THEN just print the name and continue */ if (OPTST_GET_ARGTYPE(pOD->fOptState) == OPARG_TYPE_NONE) { - fprintf( fp, "%s\n", - (DISABLED_OPT( p )) ? p->pz_DisableName : p->pz_Name ); + char const * pznm = + (DISABLED_OPT( p )) ? p->pz_DisableName : p->pz_Name; + /* + * If the option was disabled and the disablement name is NULL, + * then the disablement was caused by aliasing. + * Use the name as the string to emit. + */ + if (pznm == NULL) + pznm = p->pz_Name; + + fprintf(fp, "%s\n", pznm); continue; } diff --git a/sntp/libopts/save.c b/sntp/libopts/save.c index 22b088803..c88952075 100644 --- a/sntp/libopts/save.c +++ b/sntp/libopts/save.c @@ -437,8 +437,17 @@ optionSaveFile( tOptions* pOpts ) * THEN just print the name and continue */ if (OPTST_GET_ARGTYPE(pOD->fOptState) == OPARG_TYPE_NONE) { - fprintf( fp, "%s\n", - (DISABLED_OPT( p )) ? p->pz_DisableName : p->pz_Name ); + char const * pznm = + (DISABLED_OPT( p )) ? p->pz_DisableName : p->pz_Name; + /* + * If the option was disabled and the disablement name is NULL, + * then the disablement was caused by aliasing. + * Use the name as the string to emit. + */ + if (pznm == NULL) + pznm = p->pz_Name; + + fprintf(fp, "%s\n", pznm); continue; }