/ Check-in [1202e977]
Login

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

Overview
Comment:Fix harmless compiler warnings. In the command-line shell, report if the ".system" command returns a non-zero result.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 1202e9771f6d699dbf5268368108a3527d06d799
User & Date: drh 2014-08-06 14:36:53
Context
2014-08-06
17:49
Fix two more harmless compiler warnings. Make sure the fts3_unicode2.c file is in sync with mkunicode.tcl. check-in: a2a60307 user: drh tags: trunk
14:36
Fix harmless compiler warnings. In the command-line shell, report if the ".system" command returns a non-zero result. check-in: 1202e977 user: drh tags: trunk
11:58
Fix an obsolete comment in the func.c source file. No changes to code. check-in: 5c6bb57d user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/main.c.

  1052   1052     }
  1053   1053   }
  1054   1054   
  1055   1055   /*
  1056   1056   ** Return a static string containing the name corresponding to the error code
  1057   1057   ** specified in the argument.
  1058   1058   */
  1059         -#if defined(SQLITE_DEBUG) || defined(SQLITE_TEST)
         1059  +#if (defined(SQLITE_DEBUG) && SQLITE_OS_WIN) || defined(SQLITE_TEST)
  1060   1060   const char *sqlite3ErrName(int rc){
  1061   1061     const char *zName = 0;
  1062   1062     int i, origRc = rc;
  1063   1063     for(i=0; i<2 && zName==0; i++, rc &= 0xff){
  1064   1064       switch( rc ){
  1065   1065         case SQLITE_OK:                 zName = "SQLITE_OK";                break;
  1066   1066         case SQLITE_ERROR:              zName = "SQLITE_ERROR";             break;

Changes to src/shell.c.

  3122   3122       }
  3123   3123     }else
  3124   3124   
  3125   3125     if( c=='s'
  3126   3126      && (strncmp(azArg[0], "shell", n)==0 || strncmp(azArg[0],"system",n)==0)
  3127   3127     ){
  3128   3128       char *zCmd;
  3129         -    int i;
         3129  +    int i, x;
  3130   3130       if( nArg<2 ){
  3131   3131         fprintf(stderr, "Usage: .system COMMAND\n");
  3132   3132         rc = 1;
  3133   3133         goto meta_command_exit;
  3134   3134       }
  3135   3135       zCmd = sqlite3_mprintf(strchr(azArg[1],' ')==0?"%s":"\"%s\"", azArg[1]);
  3136   3136       for(i=2; i<nArg; i++){
  3137   3137         zCmd = sqlite3_mprintf(strchr(azArg[i],' ')==0?"%z %s":"%z \"%s\"",
  3138   3138                                zCmd, azArg[i]);
  3139   3139       }
  3140         -    (void)system(zCmd);
         3140  +    x = system(zCmd);
  3141   3141       sqlite3_free(zCmd);
         3142  +    if( x ) fprintf(stderr, "System command returns %d\n", x);
  3142   3143     }else
  3143   3144   
  3144   3145     if( c=='s' && strncmp(azArg[0], "show", n)==0 ){
  3145   3146       int i;
  3146   3147       if( nArg!=1 ){
  3147   3148         fprintf(stderr, "Usage: .show\n");
  3148   3149         rc = 1;