FU Logo
  • Startseite
  • Kontakt
  • Impressum
  • Home
  • Listenauswahl
  • Anleitungen

[linux-minidisc] Bug: Invalid characters in title strings

<-- thread -->
<-- date -->
  • From: Thomas Arp <manner.moe@gmx.de>
  • To: linux-minidisc@lists.fu-berlin.de
  • Date: Wed, 15 Jan 2014 19:43:51 +0100
  • Subject: [linux-minidisc] Bug: Invalid characters in title strings

Hi,
as reported by a user of the minidiscforum, tracks containing "/" character in the title string will fail to upload. "/" will be treated as a directory separator, so f.open() will fail because of a "missing directory".

I fixed this by removing characters of directory separator type from the title string when creating the filename for output.

This patch can be applied anytime but part #3 of the "netmd download support" patch has to be rebased when applying after this patch. I prefer applying this patch after all parts of the "netmd download support" patch have been committed.

Thomas

>From 6d26bef632420348a9a9917dc9373ad6813cfb28 Mon Sep 17 00:00:00 2001
From: Thomas Arp <manner.moe@gmx.de>
Date: Wed, 15 Jan 2014 19:28:32 +0100
Subject: [PATCH 4/4] remove characters of directory separator type from title
 string when creating filenames for writing

---
 qhimdtransfer/qmddevice.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/qhimdtransfer/qmddevice.cpp b/qhimdtransfer/qmddevice.cpp
index 0be30d6..a23616c 100644
--- a/qhimdtransfer/qmddevice.cpp
+++ b/qhimdtransfer/qmddevice.cpp
@@ -2,6 +2,7 @@
 #include <QMessageBox>
 #include <QApplication>
 #include <QFile>
+#include <QDir>
 #include <tlist.h>
 #include <fileref.h>
 #include <tfile.h>
@@ -104,6 +105,9 @@ void QMDDevice::checkfile(QString UploadDirectory, QString &filename, QString ex
     QString newname;
     int i = 2;
 
+    /* remove chars of directory separator type from filename*/
+    filename.replace(QDir::separator(), " ");
+
     f.setFileName(UploadDirectory + "/" + filename + extension);
     while(f.exists())
     {
-- 
1.8.3.2

<-- thread -->
<-- date -->
  • Follow-Ups:
    • Re: [linux-minidisc] Bug: Invalid characters in title strings
      • From: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
  • References:
    • Re: [linux-minidisc] linux-minidisc Digest, Vol 43, Issue 20
      • From: "Jurgen." <invictaz@yahoo.com>
    • Re: [linux-minidisc] linux-minidisc Digest, Vol 43, Issue 20
      • From: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
    • Re: [linux-minidisc] linux-minidisc Digest, Vol 43, Issue 20
      • From: "Jurgen." <invictaz@yahoo.com>
  • linux-minidisc - January 2014 - Archives indexes sorted by:
    [ thread ] [ subject ] [ author ] [ date ]
  • Complete archive of the linux-minidisc mailing list
  • More info on this list...

Hilfe

  • FAQ
  • Dienstbeschreibung
  • ZEDAT Beratung
  • postmaster@lists.fu-berlin.de

Service-Navigation

  • Startseite
  • Listenauswahl

Einrichtung Mailingliste

  • ZEDAT-Portal
  • Mailinglisten Portal