From ce062debb1edaa27548deea0f151a9d4c95414a7 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Sat, 6 Oct 2018 02:42:53 +0200 Subject: [PATCH] 9boot: get rid of 64 byte line length limit --- sys/src/boot/efi/sub.c | 14 +++----------- sys/src/boot/pc/sub.c | 14 +++----------- 2 files changed, 6 insertions(+), 22 deletions(-) diff --git a/sys/src/boot/efi/sub.c b/sys/src/boot/efi/sub.c index 1359b199c..798e5a92f 100644 --- a/sys/src/boot/efi/sub.c +++ b/sys/src/boot/efi/sub.c @@ -97,7 +97,7 @@ memset(void *dst, int v, int n) } static int -readline(void *f, char buf[64]) +readline(void *f, char *buf) { static char white[] = "\t "; char *p; @@ -127,14 +127,6 @@ readline(void *f, char buf[64]) break; if(p == buf && strchr(white, *p) != nil) continue; /* whitespace on start of line */ - if(p >= buf + 64-1){ - if(f == nil){ - putc('\b'); - putc(' '); - putc('\b'); - } - continue; /* line full do not advance */ - } p++; } while(p > buf && strchr(white, p[-1])) @@ -211,7 +203,7 @@ delconf(char *s) char* configure(void *f, char *path) { - char line[64], *kern, *s, *p; + char *line, *kern, *s, *p; int inblock, nowait, n; static int once = 1; @@ -227,7 +219,7 @@ Clear: nowait = 1; inblock = 0; Loop: - while(readline(f, line) > 0){ + while(readline(f, line = confend+1) > 0){ if(*line == 0 || strchr("#;=", *line) != nil) continue; if(*line == '['){ diff --git a/sys/src/boot/pc/sub.c b/sys/src/boot/pc/sub.c index 8d69ddc77..0b8380ed7 100644 --- a/sys/src/boot/pc/sub.c +++ b/sys/src/boot/pc/sub.c @@ -120,7 +120,7 @@ getc(void) } static int -readline(void *f, char buf[64]) +readline(void *f, char *buf) { static char white[] = "\t "; char *p; @@ -150,14 +150,6 @@ readline(void *f, char buf[64]) break; if(p == buf && strchr(white, *p) != nil) continue; /* whitespace on start of line */ - if(p >= buf + 64-1){ - if(f == nil){ - putc('\b'); - putc(' '); - putc('\b'); - } - continue; /* line full do not advance */ - } p++; } while(p > buf && strchr(white, p[-1])) @@ -239,7 +231,7 @@ delconf(char *s) char* configure(void *f, char *path) { - char line[64], *kern, *s, *p; + char *line, *kern, *s, *p; int inblock, nowait, n; static int once = 1; @@ -257,7 +249,7 @@ Clear: nowait = 1; inblock = 0; Loop: - while(readline(f, line) > 0){ + while(readline(f, line = confend+1) > 0){ if(*line == 0 || strchr("#;=", *line) != nil) continue; if(*line == '['){