~ubuntu-branches/debian/stretch/grub2/stretch

« back to all changes in this revision

Viewing changes to kern/rescue_reader.c

Tags: upstream-1.98+20100705
ImportĀ upstreamĀ versionĀ 1.98+20100705

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
{
35
35
  int c;
36
36
  int pos = 0;
 
37
  char str[4];
37
38
 
38
39
  grub_printf ((cont) ? "> " : "grub rescue> ");
39
40
  grub_memset (linebuf, 0, GRUB_RESCUE_BUF_SIZE);
44
45
        {
45
46
          if (pos < GRUB_RESCUE_BUF_SIZE - 1)
46
47
            {
 
48
              str[0] = c;
 
49
              str[1] = 0;
47
50
              linebuf[pos++] = c;
48
 
              grub_putchar (c);
 
51
              grub_xputs (str);
49
52
            }
50
53
        }
51
54
      else if (c == '\b')
52
55
        {
53
56
          if (pos > 0)
54
57
            {
 
58
              str[0] = c;
 
59
              str[1] = ' ';
 
60
              str[2] = c;
 
61
              str[3] = 0;
55
62
              linebuf[--pos] = 0;
56
 
              grub_putchar (c);
57
 
              grub_putchar (' ');
58
 
              grub_putchar (c);
 
63
              grub_xputs (str);
59
64
            }
60
65
        }
61
66
      grub_refresh ();
62
67
    }
63
68
 
64
 
  grub_putchar ('\n');
 
69
  grub_xputs ("\n");
65
70
  grub_refresh ();
66
71
 
67
72
  *line = grub_strdup (linebuf);