hdt: Removing builting sleep support in say
authorErwan Velu <erwanaliasr1@gmail.com>
Tue, 29 May 2012 20:32:14 +0000 (22:32 +0200)
committerErwan Velu <erwanaliasr1@gmail.com>
Tue, 29 May 2012 20:34:51 +0000 (22:34 +0200)
If people want to sleep while saying message, they now have to use the
sleep command instead of the previous specific %x syntax.

com32/hdt/floppy/hdt.cfg
com32/hdt/hdt-cli-hdt.c

index a5afd60..7cfe6a7 100644 (file)
@@ -93,7 +93,7 @@ TEXT HELP
  VESA mode is enabled
 ENDTEXT
 COM32 hdt.c32
-APPEND modules_pcimap=modules.pcimap modules_alias=modules.alias pciids=pci.ids quiet vesa nomenu auto='show memory;say `########`;say `Starting memtest in 5 sec`%5;exit' postexec='memtest'
+APPEND modules_pcimap=modules.pcimap modules_alias=modules.alias pciids=pci.ids quiet vesa nomenu auto='show memory;say `########`;say `Starting memtest in 5 sec`;sleep 5;exit' postexec='memtest'
 
 LABEL display
 MENU LABEL Display feature (VESA mode)
index 70cd049..3af6770 100644 (file)
@@ -294,7 +294,6 @@ static void do_say(int argc , char **argv ,
 
    char text_to_say[255]={0};
    int arg=0;
-   int sleep_time=0;
 #if DEBUG
    for (int i=0; i<argc;i++) dprintf("SAY: arg[%d]={%s}\n",i,argv[i]);
 #endif
@@ -317,24 +316,7 @@ static void do_say(int argc , char **argv ,
        dprintf("SAY CMD = [%s]\n",text_to_say);           
        }
 
-       /* The % char can be in the same argument, let's consider it again */
-       arg--;
-
-       /* Searching for a % argument to determine the time to show the message */
-       char *time_to_display = NULL;
-       /* Search for a requested time to display */
-       while ( ((time_to_display=strchr(argument, '%')) == NULL) && (arg+1<argc)) {
-               arg++;
-               argument = (char *)argv[arg];
-       }
-
-       if (time_to_display != NULL) {
-               sleep_time=atoi(time_to_display+1);
-               dprintf("SAY CMD :Time to display = %d\n",sleep_time);     
-       }
-
        printf("%s\n",text_to_say);
-       sleep(sleep_time);
   }
 }