diff options
author | larrybr <larrybr@noemail.net> | 2021-10-03 22:03:59 +0000 |
---|---|---|
committer | larrybr <larrybr@noemail.net> | 2021-10-03 22:03:59 +0000 |
commit | d797d6b626996f62bd0fc499e3d8eff2483e02ea (patch) | |
tree | c3f6969969123ac6fb76e54c5949f1e27cb08dea /src | |
parent | 5bf4715e0184cceca87c372af609959c6df75b43 (diff) | |
download | sqlite-d797d6b626996f62bd0fc499e3d8eff2483e02ea.tar.gz sqlite-d797d6b626996f62bd0fc499e3d8eff2483e02ea.zip |
In CLI, ensure correct line-accumulation state whenever line(s) are dumped or processed. And test this.
FossilOrigin-Name: be211a9c59234ef202e772fcaae18be43c44e1e00674f137cad2d903e00bfcab
Diffstat (limited to 'src')
-rw-r--r-- | src/shell.c.in | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/shell.c.in b/src/shell.c.in index cf04378db..1f98731aa 100644 --- a/src/shell.c.in +++ b/src/shell.c.in @@ -10832,7 +10832,8 @@ static int process_input(ShellState *p){ if( QSS_PLAINWHITE(qss) && nSql==0 ){ if( ShellHasFlag(p, SHFLG_Echo) ) printf("%s\n", zLine); - /* Just swallow leading whitespace */ + /* Just swallow single-line whitespace */ + qss = QSS_Start; continue; } if( zLine && (zLine[0]=='.' || zLine[0]=='#') && nSql==0 ){ @@ -10848,6 +10849,7 @@ static int process_input(ShellState *p){ qss = QSS_Start; continue; } + /* No single-line dispositions remain; accumulate line(s). */ nLine = strlen30(zLine); if( nSql+nLine+2>=nAlloc ){ /* Grow buffer by half-again increments when big. */ @@ -10877,9 +10879,11 @@ static int process_input(ShellState *p){ clearTempFile(p); } p->bSafeMode = p->bSafeModePersist; + qss = QSS_Start; }else if( nSql && QSS_PLAINWHITE(qss) ){ if( ShellHasFlag(p, SHFLG_Echo) ) printf("%s\n", zSql); nSql = 0; + qss = QSS_Start; } } if( nSql && QSS_PLAINDARK(qss) ){ |