"Scott Card" <[EMAIL PROTECTED]> writes:

> Is there a reason for the argument limit in the menu_choice method?

The code constructs the argument to choice.exe by appending the string
representation of consecutive numbers together; effectively doing:

  '1' . '2' . '3'   (and so on)

choice.exe uses that string as the list of possible single-key inputs.

This algorithm is very simple, but bad things happen to it when you
get past 9 :-).  I did not want to think about it, so I put in the
assertion to preempt the less-obvious failure mode.

I am appending a patch to increase the allowed number of options to
15.  Please test it out and let me know if it works.  Also, let me
know if 15 is also not enough...

 - Pat

Index: install/dosbin/install.pl
===================================================================
RCS file: /cvsroot/unattended/unattended/install/dosbin/install.pl,v
retrieving revision 1.32
diff -u -r1.32 install.pl
--- install/dosbin/install.pl   11 Feb 2003 05:44:27 -0000      1.32
+++ install/dosbin/install.pl   11 Feb 2003 20:23:13 -0000
@@ -30,7 +30,7 @@
     scalar @args % 2 == 0
         or croak "menu_choice called with odd number of arguments";
 
-    scalar @args > 18
+    scalar @args > 30
         and croak "menu_choice called with too many arguments";
 
     print "\n";
@@ -40,8 +40,9 @@
     while (exists $args[0]) {
         my $option = shift @args;
         my $value = shift @args;
-        print "$i) $option\n";
-        $choices .= $i;
+        my $key = sprintf '%X', $i;
+        print "$key) $option\n";
+        $choices .= $key;
         $choice_map[$i] = $value;
         $i++;
     }


-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
unattended-info mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/unattended-info

Reply via email to