properly escape a path when creating a test file during tests
authorMatthieu Gallien <matthieu.gallien@nextcloud.com>
Wed, 9 Nov 2022 15:36:38 +0000 (16:36 +0100)
committerMatthieu Gallien <matthieu_gallien@yahoo.fr>
Wed, 9 Nov 2022 17:35:10 +0000 (18:35 +0100)
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
test/testfolderwatcher.cpp

index d8c7da0924f7ff3b09567ec2e995abed8aa1e307..c8ac44d40d3f676f3600a09a29eeb219b9dcd60d 100644 (file)
@@ -147,7 +147,7 @@ private slots:
     void testACreate() { // create a new file
         QString file(_rootPath + "/foo.txt");
         QString cmd;
-        cmd = QString("echo \"xyz\" > %1").arg(file);
+        cmd = QString("echo \"xyz\" > \"%1\"").arg(file);
         qDebug() << "Command: " << cmd;
         system(cmd.toLocal8Bit());