"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files
Go azure-blobazure-blob-storageazure-filesbackblaze-b2cloud-storagedropboxencryptionftpfuse-filesystemgogolanggoogle-cloud-storagegoogle-driveonedriveopenstack-swiftrclones3sftpsyncwebdav
drive: use contains for name matching in list
Fabian Möllerf62201753981
diff --git a/backend/drive/debug.test b/backend/drive/debug.testnew file mode 100755index 000000000..1ff321af7Binary files /dev/null and b/backend/drive/debug.test differdiff --git a/backend/drive/drive.go b/backend/drive/drive.goindex ef9b23e59..dfc2349d5 100644--- a/backend/drive/drive.go+++ b/backend/drive/drive.go@@ -248,11 +248,12 @@ func (f *Fs) list(dirID string, title string, directoriesOnly bool, filesOnly bo}if title != "" {// Escaping the backslash isn't documented but seems to work- title = strings.Replace(title, `\`, `\\`, -1)- title = strings.Replace(title, `'`, `\'`, -1)+ searchTitle := strings.Replace(title, `\`, `\\`, -1)+ searchTitle = strings.Replace(searchTitle, `'`, `\'`, -1)// Convert / to / for search- title = strings.Replace(title, "/", "/", -1)- query = append(query, fmt.Sprintf("name='%s'", title))+ searchTitle = strings.Replace(searchTitle, "/", "/", -1)+ // use contains to work around #1675+ query = append(query, fmt.Sprintf("name contains '%s'", searchTitle))}if directoriesOnly {query = append(query, fmt.Sprintf("mimeType='%s'", driveFolderType))@@ -296,6 +297,10 @@ OUTER:for _, item := range files.Files {// Convert / to / for listing purposesitem.Name = strings.Replace(item.Name, "/", "/", -1)+ // skip items introduced by workaround (#1675)+ if title != "" && title != item.Name {+ continue+ }if fn(item) {found = truebreak OUTER