/[grub]/grub2/normal/cmdline.c
ViewVC logotype

Diff of /grub2/normal/cmdline.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.10 by marco_g, Mon Dec 13 17:26:17 2004 UTC revision 1.11 by marco_g, Wed Dec 29 22:43:48 2004 UTC
# Line 556  grub_cmdline_get (const char *prompt, ch Line 556  grub_cmdline_get (const char *prompt, ch
556        
557    cl_insert (cmdline);    cl_insert (cmdline);
558    
559    grub_history_add (buf);    if (hist_used == 0)
560        grub_history_add (buf);
561    
562    while ((key = GRUB_TERM_ASCII_CHAR (grub_getkey ())) != '\n' && key != '\r')    while ((key = GRUB_TERM_ASCII_CHAR (grub_getkey ())) != '\n' && key != '\r')
563      {      {
# Line 641  grub_cmdline_get (const char *prompt, ch Line 642  grub_cmdline_get (const char *prompt, ch
642                  lpos = 0;                  lpos = 0;
643    
644                  if (histpos > 0)                  if (histpos > 0)
645                    histpos--;                    {
646                        grub_history_replace (histpos, buf);
647                        histpos--;
648                      }
649    
650                  cl_delete (llen);                  cl_delete (llen);
651                  hist = grub_history_get (histpos);                  hist = grub_history_get (histpos);
# Line 656  grub_cmdline_get (const char *prompt, ch Line 660  grub_cmdline_get (const char *prompt, ch
660                  lpos = 0;                  lpos = 0;
661    
662                  if (histpos < hist_used - 1)                  if (histpos < hist_used - 1)
663                    histpos++;                    {
664                        grub_history_replace (histpos, buf);
665                        histpos++;
666                      }
667    
668                  cl_delete (llen);                  cl_delete (llen);
669                  hist = grub_history_get (histpos);                  hist = grub_history_get (histpos);
# Line 723  grub_cmdline_get (const char *prompt, ch Line 730  grub_cmdline_get (const char *prompt, ch
730              }              }
731            break;            break;
732          }          }
   
       grub_history_replace (histpos, buf);  
733      }      }
734    
735    grub_putchar ('\n');    grub_putchar ('\n');
# Line 736  grub_cmdline_get (const char *prompt, ch Line 741  grub_cmdline_get (const char *prompt, ch
741      while (buf[lpos] == ' ')      while (buf[lpos] == ' ')
742        lpos++;        lpos++;
743    
744      histpos = 0;
745      if (grub_strlen (buf) > 0)
746        {
747          grub_history_replace (histpos, buf);
748          grub_history_add ("");
749        }
750      
751    grub_memcpy (cmdline, buf + lpos, llen - lpos + 1);    grub_memcpy (cmdline, buf + lpos, llen - lpos + 1);
752    
753    return 1;    return 1;

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.11

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26