]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
[Bug 902] Fix problems with the -6 flag
authorHarlan Stenn <stenn@ntp.org>
Mon, 10 Sep 2007 05:57:20 +0000 (01:57 -0400)
committerHarlan Stenn <stenn@ntp.org>
Mon, 10 Sep 2007 05:57:20 +0000 (01:57 -0400)
bk: 46e4dcc09d9lJO72n1BB3KXVWdP_kA

ChangeLog
libopts/save.c
sntp/libopts/save.c

index 7a9fe0a904dcca550f4ae5802e486d8814aa0111..77468becc0b66bdee8540810023e32ab5d98b3ea 100644 (file)
--- 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.
index 22b0888032c7841a28a6e21c6a62018d49f6fa67..c889520752f5c068cdd36ebeeebe6169669eea35 100644 (file)
@@ -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;
         }
 
index 22b0888032c7841a28a6e21c6a62018d49f6fa67..c889520752f5c068cdd36ebeeebe6169669eea35 100644 (file)
@@ -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;
         }