/ Check-in [4258fb57]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix the command-line shell so that the ".schema --indent" command does a better job of dealing with \r\n in the middle of a CREATE statement in the schema.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 4258fb578a6e75590c7314fe511ca8dc6659e5f2d3a54d8f60ff705fe51ccc92
User & Date: drh 2017-10-05 19:12:10
Context
2017-10-05
20:02
Fix a problem building with SQLITE_OMIT_WAL defined. check-in: 373b0ace user: dan tags: trunk
19:12
Fix the command-line shell so that the ".schema --indent" command does a better job of dealing with \r\n in the middle of a CREATE statement in the schema. check-in: 4258fb57 user: drh tags: trunk
11:29
Disable the delta checksum verification in RBU by default. Reenable it using -DRBU_ENABLE_DELTA_CKSUM, if desired. check-in: d22c99b6 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/shell.c.

  2769   2769           break;
  2770   2770         }
  2771   2771         z = sqlite3_mprintf("%s", azArg[0]);
  2772   2772         j = 0;
  2773   2773         for(i=0; IsSpace(z[i]); i++){}
  2774   2774         for(; (c = z[i])!=0; i++){
  2775   2775           if( IsSpace(c) ){
         2776  +          if( z[j-1]=='\r' ) z[j-1] = '\n';
  2776   2777             if( IsSpace(z[j-1]) || z[j-1]=='(' ) continue;
  2777   2778           }else if( (c=='(' || c==')') && j>0 && IsSpace(z[j-1]) ){
  2778   2779             j--;
  2779   2780           }
  2780   2781           z[j++] = c;
  2781   2782         }
  2782   2783         while( j>0 && IsSpace(z[j-1]) ){ j--; }

Changes to src/shell.c.in.

  1409   1409           break;
  1410   1410         }
  1411   1411         z = sqlite3_mprintf("%s", azArg[0]);
  1412   1412         j = 0;
  1413   1413         for(i=0; IsSpace(z[i]); i++){}
  1414   1414         for(; (c = z[i])!=0; i++){
  1415   1415           if( IsSpace(c) ){
         1416  +          if( z[j-1]=='\r' ) z[j-1] = '\n';
  1416   1417             if( IsSpace(z[j-1]) || z[j-1]=='(' ) continue;
  1417   1418           }else if( (c=='(' || c==')') && j>0 && IsSpace(z[j-1]) ){
  1418   1419             j--;
  1419   1420           }
  1420   1421           z[j++] = c;
  1421   1422         }
  1422   1423         while( j>0 && IsSpace(z[j-1]) ){ j--; }