mirror of
				https://github.com/sqlite/sqlite.git
				synced 2025-11-03 16:53:36 +03:00 
			
		
		
		
	Only quote the arguments to the ".shell" and ".system" commands if they
contain spaces. FossilOrigin-Name: e58f4bd39d51c4c1a28684dab6427de81173d564
This commit is contained in:
		@@ -2909,9 +2909,10 @@ static int do_meta_command(char *zLine, struct callback_data *p){
 | 
			
		||||
  ){
 | 
			
		||||
    char *zCmd;
 | 
			
		||||
    int i;
 | 
			
		||||
    zCmd = sqlite3_mprintf("\"%s\"", azArg[1]);
 | 
			
		||||
    zCmd = sqlite3_mprintf(strchr(azArg[1],' ')==0?"%s":"\"%s\"", azArg[1]);
 | 
			
		||||
    for(i=2; i<nArg; i++){
 | 
			
		||||
      zCmd = sqlite3_mprintf("%z \"%s\"", zCmd, azArg[i]);
 | 
			
		||||
      zCmd = sqlite3_mprintf(strchr(azArg[i],' ')==0?"%z %s":"%z \"%s\"",
 | 
			
		||||
                             zCmd, azArg[i]);
 | 
			
		||||
    }
 | 
			
		||||
    system(zCmd);
 | 
			
		||||
    sqlite3_free(zCmd);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user