8000 drive: fixed the issue where Google Docs file name was truncated, cau… · rclone/rclone@933e0b3 · GitHub
[go: up one dir, main page]

Skip to content

Commit 933e0b3

Browse files
jaycee88duanyanqing
authored andcommitted
drive: fixed the issue where Google Docs file name was truncated, causing panic or unparseable characters
When downloading Google documents, the remote does not contain the suffix, and the extension is '.docx'. The code here will cause panic or the file name will be truncated (if the file name is Chinese or Japanese, there will be unparseable characters) 8000
1 parent 22abcc9 commit 933e0b3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

backend/drive/drive.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1495,7 +1495,7 @@ func (f *Fs) NewObject(ctx context.Context, remote string) (fs.Object, error) {
14951495
return nil, err
14961496
}
14971497

1498-
remote = remote[:len(remote)-len(extension)]
1498+
remote = strings.TrimSuffix(remote, extension)
14991499
obj, err := f.newObjectWithExportInfo(ctx, remote, info, extension, exportName, exportMimeType, isDocument)
15001500
switch {
15011501
case err != nil:

0 commit comments

Comments
 (0)
0