Bug#496308: If input and output dir differ galrey doesn't work

2008-08-24 Thread Matthew Johnson
Package: galrey
Version: 1.0.2-2
Severity: important


If the input and output directories differ then the HTML files and the
thumbnails are written to the output directory, but when running
identify on the thumbnails they are looked for in the input directory
and the  tags in the html for the originals looks in the output
directory.

-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)

Kernel: Linux 2.6.25-2-686 (SMP w/2 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages galrey depends on:
ii  imagemagick 7:6.3.7.9.dfsg1-2+b2 image manipulation programs
ii  perl5.10.0-11.1  Larry Wall's Practical Extraction 

galrey recommends no packages.

galrey suggests no packages.

-- no debconf information


signature.asc
Description: Digital signature


Bug#369260: Preparing fix

2006-12-09 Thread Matthew Johnson

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

owner 369260 !
tags 369260 patch pending
thanks

I've filed an ITA for id3ren and have a patch which fixes this bug
(attached). I'm preparing an upload to adopt the package with this bug
fix in. I'll also send the patch to upstream, but they are fairly
inactive so the fix is included in the Debian diff for now.

Matt

- -- 
Matthew Johnson

http://www.matthew.ath.cx/
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Made with pgp4pine 1.76

iD8DBQFFeuz7pldmHVvob7kRArgnAJ9BGSrZscxLXejQAHJpv5sO7FCLqwCfbepb
0iN52FM8/lJpd0KzG69SBi4=
=pY/C
-END PGP SIGNATURE-
--- id3ren-1.1b0.orig/src/id3ren.c
+++ id3ren-1.1b0/src/id3ren.c
@@ -131,6 +131,8 @@
   applied_filename[0] = '\0';
   ptrNewfile = applied_filename;
 
+  if (NULL != def_field) sanitize(def_field);
+
   while (filename_template[tcount] != '\0')
   {
 if (filename_template[tcount] == IDENT_CHAR)
@@ -140,39 +142,44 @@
   switch (filename_template[tcount])
   {
 case 'a': 
-  if(strcmp(ptrtag->artist,"")!=0)
+  if(strcmp(ptrtag->artist,"")!=0) {
+   sanitize(ptrtag->artist);
strcat(applied_filename, ptrtag->artist); 
-  else if(def_field!=NULL)
+  } else if(def_field!=NULL)
strcat(applied_filename, def_field); 
   break;
 case 'c': 
-  if(strcmp(ptrtag->u.v10.comment,"")!=0)
+  if(strcmp(ptrtag->u.v10.comment,"")!=0) {
+   sanitize(ptrtag->u.v10.comment);
strcat(applied_filename, ptrtag->u.v10.comment);
-  else if(def_field!=NULL)
+  } else if(def_field!=NULL)
strcat(applied_filename, def_field); 
   break;
 case 'g':
-  if (ptrtag->genre < genre_count && ptrtag->genre >= 0)
+  if (ptrtag->genre < genre_count && ptrtag->genre >= 0) 
strcat(applied_filename, genre_table[ptrtag->genre]);
-  else if(def_field!=NULL)
+   else if(def_field!=NULL)
strcat(applied_filename, def_field); 
   break;
 case 's': 
-  if(strcmp(ptrtag->songname,"")!=0)
+  if(strcmp(ptrtag->songname,"")!=0) {
+   sanitize(ptrtag->songname);
strcat(applied_filename, ptrtag->songname); 
-  else if(def_field!=NULL)
+  } else if(def_field!=NULL)
strcat(applied_filename, def_field); 
   break;
 case 't': 
-  if(strcmp(ptrtag->album,"")!=0)
+  if(strcmp(ptrtag->album,"")!=0) {
+   sanitize(ptrtag->album);
strcat(applied_filename, ptrtag->album); 
-  else if(def_field!=NULL)
+  } else if(def_field!=NULL)
strcat(applied_filename, def_field); 
   break;
 case 'y': 
-  if(strcmp(ptrtag->year,"")!=0)
+  if(strcmp(ptrtag->year,"")!=0) {
+   sanitize(ptrtag->year);
strcat(applied_filename, ptrtag->year); 
-  else if(def_field!=NULL)
+  } else if(def_field!=NULL)
strcat(applied_filename, def_field); 
   break;
 case 'n':   
@@ -249,26 +256,28 @@
   }
 
   *ptrNewfile = '\0';
+}
 
+void sanitize(char* string)
+{
+  int i;
   /* Convert illegal or bad filename characters to good characters */
-  for (i=0; i < strlen(applied_filename); i++)
+  for (i=0; i < strlen(string); i++)
   {
-switch (applied_filename[i])
+switch (string[i])
 {
-  case '<': applied_filename[i] = '['; break;
-  case '>': applied_filename[i] = ']'; break;
-  case '|': applied_filename[i] = '_'; break;
-  // this is now used to create dirs
-  //case '/': applied_filename[i] = '-'; break;
-  case '\\': applied_filename[i]= '-'; break;
-  case '*': applied_filename[i] = '_'; break;
-  case '?': applied_filename[i] = '_'; break;
-  case ':': applied_filename[i] = ';'; break;
-  case '"': applied_filename[i] = '-'; break;
+  case '<': string[i] = '['; break;
+  case '>': string[i] = ']'; break;
+  case '|': string[i] = '_'; break;
+  case '/': string[i] = '-'; break;
+  case '\\': string[i]= '-'; break;
+  case '*': string[i] = '_'; break;
+  case '?': string[i] = '_'; break;
+  case ':': string[i] = ';'; break;
+  case '"': string[i] = '-'; break;
   default: break;
 }
   }
-
 }