[smuxi: 1/3] SqliteMessageBuffer: wrap dbpath in double-quotes to escape it



commit e88aaf32e92b9be61e29a21b12765617bb0dad6c
Author: Andrés G. Aragoneses <knocte gmail com>
Date:   Wed Apr 29 19:29:00 2015 +0200

    SqliteMessageBuffer: wrap dbpath in double-quotes to escape it
    
    Launching a multi-username /timeline command, when using Sqlite
    persistence, was giving a ConnectionString initialization error.
    The problem was Sqlite handling commas in the same way as semicolons
    when parsing the connection string.
    
    The easiest way to fix this is just wrap the path with double-quotes.

 src/Engine/MessageBuffers/SqliteMessageBuffer.cs |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/src/Engine/MessageBuffers/SqliteMessageBuffer.cs 
b/src/Engine/MessageBuffers/SqliteMessageBuffer.cs
index 36b483e..f156836 100644
--- a/src/Engine/MessageBuffers/SqliteMessageBuffer.cs
+++ b/src/Engine/MessageBuffers/SqliteMessageBuffer.cs
@@ -76,7 +76,8 @@ namespace Smuxi.Engine
         void Init()
         {
             Connection = new SqliteConnection(
-                "Data Source=" + DBPath + ";" +
+                //extra double-quotes are needed to prevent conflicting connectionString chars in the path 
such as ','
+                "Data Source=\"" + DBPath + "\";" +
                 // enable Write-Ahead-Log (WAL)
                 "Journal Mode=WAL"
             );


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]