/ Check-in [6b8178de]
Login

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

Overview
Comment:The command-line shell should avoid writing changes into string constants. (CVS 1886)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 6b8178de9936e48ed69d1546218b5def6665b459
User & Date: drh 2004-08-14 18:18:44
Context
2004-08-14
18:34
Fix a bug that was preventing "PRAGMA temp_store=MEMORY" from working. (CVS 1887) check-in: bb558945 user: drh tags: trunk
18:18
The command-line shell should avoid writing changes into string constants. (CVS 1886) check-in: 6b8178de user: drh tags: trunk
17:10
Add the ability to specify a alternative temporary file directory using the "sqlite_temp_directory" global variable. (CVS 1885) check-in: fce56ba6 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/shell.c.

     8      8   **    May you find forgiveness for yourself and forgive others.
     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   *************************************************************************
    12     12   ** This file contains code to implement the "sqlite" command line
    13     13   ** utility for accessing SQLite databases.
    14     14   **
    15         -** $Id: shell.c,v 1.110 2004/08/08 20:22:18 drh Exp $
           15  +** $Id: shell.c,v 1.111 2004/08/14 18:18:44 drh Exp $
    16     16   */
    17     17   #include <stdlib.h>
    18     18   #include <string.h>
    19     19   #include <stdio.h>
    20     20   #include <assert.h>
    21     21   #include "sqlite3.h"
    22     22   #include <ctype.h>
................................................................................
   843    843   
   844    844     if( c=='e' && strncmp(azArg[0], "exit", n)==0 ){
   845    845       rc = 1;
   846    846     }else
   847    847   
   848    848     if( c=='e' && strncmp(azArg[0], "explain", n)==0 ){
   849    849       int j;
   850         -    char *z = nArg>=2 ? azArg[1] : "1";
          850  +    static char zOne[] = "1";
          851  +    char *z = nArg>=2 ? azArg[1] : zOne;
   851    852       int val = atoi(z);
   852    853       for(j=0; z[j]; j++){
   853    854         z[j] = tolower((unsigned char)z[j]);
   854    855       }
   855    856       if( strcmp(z,"on")==0 ){
   856    857         val = 1;
   857    858       }else if( strcmp(z,"yes")==0 ){