[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

cdebconf and text.so : problem with default answers.



Package: Debian-Installer
Version: CVS (May, 4th 2001)
Severity: normal


I found a small bug in cdebconf's gestion of default values for "select"
questions.

Function command_set of commands.c, forgets spaces in concatainating
strings :
hear is a diff :

***************
*** 352,359 ****
        else
        {
                buf[0] = 0;
!               for (i = 2; i <= argc; i++)
                        strvacat(buf, sizeof(buf), argv[i], 0);
  
                question_setvalue(q, buf);
  
--- 352,363 ----
        else
        {
                buf[0] = 0;
!               for (i = 2; i <= argc; i++) {
                        strvacat(buf, sizeof(buf), argv[i], 0);
+                       strvacat(buf, sizeof(buf), " ", 0);
+               }
+               if (strlen(buf) != 0)
+                         buf[strlen(buf)-1] = 0;
  
                question_setvalue(q, buf);






I also found a small problem in text.c frontend
Hear is a diff :

***************
*** 308,314 ****
                if (defval != NULL)
                {
                        for (i = 0; i < count; i++)
!                               if (strcmp(choices[i], defval))
                                        def = i + 1;
                }
  
--- 308,314 ----
                if (defval != NULL)
                {
                        for (i = 0; i < count; i++)
!                               if (!strcmp(choices[i], defval))
                                        def = i + 1;
                }
  

***************
*** 316,322 ****
                {
                        for (i = 0; i < count; i++)
                                printf("%3d. %s%s\n", i+1, choices[i],
!                                       (def == i ? _(" (default)") :
""));
  
                        printf(_("Prompt: 1 - %d> "), count);
                        fgets(answer, sizeof(answer), stdin);
--- 316,322 ----
                {
                        for (i = 0; i < count; i++)
                                printf("%3d. %s%s\n", i+1, choices[i],
!                                       (def == i+1 ? _(" (default)") :
""));
  
                        printf(_("Prompt: 1 - %d> "), count);
                        fgets(answer, sizeof(answer), stdin);



Using these two modifications, cdebconf & text-frontend are correctly
dealing with default values.

PS : I never used multi-select, but it probably has the same problem.



Reply to: