1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

better column labels in select results (CVS 110)

FossilOrigin-Name: 3bf434d93a54a24f4882d0d9375f82ceee0b7602
This commit is contained in:
drh
2000-07-29 13:06:59 +00:00
parent 0e981533d8
commit e1b6a5b803
10 changed files with 129 additions and 44 deletions

View File

@@ -41,7 +41,7 @@
** But other routines are also provided to help in building up
** a program instruction by instruction.
**
** $Id: vdbe.c,v 1.35 2000/07/28 14:32:50 drh Exp $
** $Id: vdbe.c,v 1.36 2000/07/29 13:06:59 drh Exp $
*/
#include "sqliteInt.h"
#include <unistd.h>
@@ -352,6 +352,32 @@ void sqliteVdbeDequoteP3(Vdbe *p, int addr){
sqliteDequote(z);
}
/*
** On the P3 argument of the given instruction, change all
** strings of whitespace characters into a single space and
** delete leading and trailing whitespace.
*/
void sqliteVdbeCompressSpace(Vdbe *p, int addr){
char *z;
int i, j;
if( addr<0 || addr>=p->nOp ) return;
z = p->aOp[addr].p3;
i = j = 0;
while( isspace(z[i]) ){ i++; }
while( z[i] ){
if( isspace(z[i]) ){
z[j++] = ' ';
while( isspace(z[++i]) ){}
}else{
z[j++] = z[i++];
}
}
while( i>0 && isspace(z[i-1]) ){
z[i-1] = 0;
i--;
}
}
/*
** Create a new symbolic label for an instruction that has yet to be
** coded. The symbolic label is really just a negative number. The