mscan: delay loading of map until first line is read

pull/1/merge
Christian Neukirchen 8 years ago
parent a2f2a80ee2
commit af9e32ecf8

@ -50,6 +50,16 @@ u8putstr(FILE *out, char *s, size_t l, int pad)
void
oneline(char *file)
{
static int init;
if (!init) {
// delay loading of the seqmap until we need to scan the first
// file, in case someone in the pipe updated the map before
char *seqmap = blaze822_seq_open(0);
blaze822_seq_load(seqmap);
cur = blaze822_seq_cur();
init = 1;
}
int indent = 0;
while (*file == ' ' || *file == '\t') {
indent++;
@ -168,10 +178,6 @@ main(int argc, char *argv[])
if (cols <= 40)
cols = 80;
char *seqmap = blaze822_seq_open(0);
blaze822_seq_load(seqmap);
cur = blaze822_seq_cur();
long i;
if (argc == 1 && isatty(0)) {
char *all[] = { ":" };

Loading…
Cancel
Save