File xmms2-0.7-remove-path_max.patch of Package xmms2

Description: Replace PATH_MAX by XMMS_PATH_MAX to fix FTBFS on hurd-i386
 This is only a workaround. Fixing these issues usually boils down to replacing
 char foo[PATH_MAX] by char *foo, and using dynamic memory allocation.
Author: Benjamin Drung <bdrung@ubuntu.com>
Bug: http://bugs.xmms2.xmms.se/view.php?id=2347

--- xmms2-0.7DrNo.orig/src/clients/cli/main.c
+++ xmms2-0.7DrNo/src/clients/cli/main.c
@@ -128,17 +128,17 @@ parse_config (const gchar *buffer)
 
 static gchar *
 get_config_dir (void) {
-	gchar userconf[PATH_MAX];
+	gchar userconf[XMMS_PATH_MAX];
 
-	xmmsc_userconfdir_get (userconf, PATH_MAX);
+	xmmsc_userconfdir_get (userconf, XMMS_PATH_MAX);
 	return g_build_path (G_DIR_SEPARATOR_S, userconf, "clients", NULL);
 }
 
 static gchar *
 get_config_path (void) {
-	gchar userconf[PATH_MAX];
+	gchar userconf[XMMS_PATH_MAX];
 
-	xmmsc_userconfdir_get (userconf, PATH_MAX);
+	xmmsc_userconfdir_get (userconf, XMMS_PATH_MAX);
 	return g_build_path (G_DIR_SEPARATOR_S, userconf, "clients", "cli.conf",
 	                     NULL);
 }
--- xmms2-0.7DrNo.orig/src/clients/cli/common.c
+++ xmms2-0.7DrNo/src/clients/cli/common.c
@@ -20,7 +20,7 @@
 gchar *
 format_url (gchar *item, GFileTest test)
 {
-	gchar *url, rpath[PATH_MAX], *p;
+	gchar *url, rpath[XMMS_PATH_MAX], *p;
 
 	p = strchr (item, ':');
 	if (!(p && p[1] == '/' && p[2] == '/')) {
--- xmms2-0.7DrNo.orig/src/clients/nycli/configuration.c
+++ xmms2-0.7DrNo/src/clients/nycli/configuration.c
@@ -125,9 +125,9 @@ configuration_init (const gchar *path)
 
 	history_file = configuration_get_string (config, "HISTORY_FILE");
 	if (!history_file || !*history_file) {
-		gchar cfile[PATH_MAX];
+		gchar cfile[XMMS_PATH_MAX];
 
-		xmms_usercachedir_get (cfile, PATH_MAX);
+		xmms_usercachedir_get (cfile, XMMS_PATH_MAX);
 		config->histpath = g_build_filename (cfile, HISTORY_FILE_BASE, NULL);
 	} else {
 		config->histpath = strdup (history_file);
--- xmms2-0.7DrNo.orig/src/clients/launcher/xmms2-launcher.c
+++ xmms2-0.7DrNo/src/clients/launcher/xmms2-launcher.c
@@ -71,8 +71,8 @@ main (int argc, char **argv)
 	}
 	
 	if (!logfile) {
-		char cache[PATH_MAX];
-		xmms_usercachedir_get (cache, PATH_MAX);
+		char cache[XMMS_PATH_MAX];
+		xmms_usercachedir_get (cache, XMMS_PATH_MAX);
 		logfile = g_build_filename (cache, "xmms2d.log", NULL);
 		if (!g_file_test (cache, G_FILE_TEST_IS_DIR)) {
 			g_mkdir_with_parents (cache, 0755);
--- xmms2-0.7DrNo.orig/src/clients/lib/perl/XMMSClient.xs
+++ xmms2-0.7DrNo/src/clients/lib/perl/XMMSClient.xs
@@ -1408,9 +1408,9 @@ Get the absolute path to the user config
 const char *
 xmmsc_userconfdir_get (class)
 	PREINIT:
-		char path[PATH_MAX];
+		char path[XMMS_PATH_MAX];
 	CODE:
-		RETVAL = xmmsc_userconfdir_get (path, PATH_MAX);
+		RETVAL = xmmsc_userconfdir_get (path, XMMS_PATH_MAX);
 	OUTPUT:
 		RETVAL
 
--- xmms2-0.7DrNo.orig/src/clients/lib/ruby/rb_xmmsclient_main.c
+++ xmms2-0.7DrNo/src/clients/lib/ruby/rb_xmmsclient_main.c
@@ -33,9 +33,9 @@ static VALUE
 m_userconfdir_get (VALUE self)
 {
 	const char *p;
-	char path[PATH_MAX];
+	char path[XMMS_PATH_MAX];
 
-	p = xmmsc_userconfdir_get (path, PATH_MAX);
+	p = xmmsc_userconfdir_get (path, XMMS_PATH_MAX);
 
 	return p ? rb_str_new2 (p) : Qnil;
 }
--- xmms2-0.7DrNo.orig/src/plugins/mp4/mp4ff/drms.c
+++ xmms2-0.7DrNo/src/plugins/mp4/mp4ff/drms.c
@@ -131,7 +131,7 @@ struct drms_s
     uint32_t p_key[ 4 ];
     struct aes_s aes;
 
-    char     psz_homedir[ PATH_MAX ];
+    char     psz_homedir[ XMMS_PATH_MAX ];
 };
 
 /*****************************************************************************
@@ -204,8 +204,8 @@ void *drms_alloc( char *psz_homedir )
 
     memset( p_drms, 0, sizeof(struct drms_s) );
 
-    strncpy( p_drms->psz_homedir, psz_homedir, PATH_MAX );
-    p_drms->psz_homedir[ PATH_MAX - 1 ] = '\0';
+    strncpy( p_drms->psz_homedir, psz_homedir, XMMS_PATH_MAX );
+    p_drms->psz_homedir[ XMMS_PATH_MAX - 1 ] = '\0';
 
     return (void *)p_drms;
 }
@@ -820,9 +820,9 @@ static int WriteUserKey( void *_p_drms, 
     struct drms_s *p_drms = (struct drms_s *)_p_drms;
     FILE *file;
     int i_ret = -1;
-    char psz_path[ PATH_MAX ];
+    char psz_path[ XMMS_PATH_MAX ];
 
-    sprintf( psz_path, /* PATH_MAX - 1, */
+    sprintf( psz_path, /* XMMS_PATH_MAX - 1, */
               "%s/" DRMS_DIRNAME, p_drms->psz_homedir );
 
 #if defined( HAVE_ERRNO_H )
@@ -835,7 +835,7 @@ static int WriteUserKey( void *_p_drms, 
     if( !mkdir( psz_path ) )
 #endif
     {
-        sprintf( psz_path, /*PATH_MAX - 1,*/ "%s/" DRMS_DIRNAME "/%08X.%03d",
+        sprintf( psz_path, /*XMMS_PATH_MAX - 1,*/ "%s/" DRMS_DIRNAME "/%08X.%03d",
                   p_drms->psz_homedir, p_drms->i_user, p_drms->i_key );
 
         file = fopen( psz_path, "w" );
@@ -860,9 +860,9 @@ static int ReadUserKey( void *_p_drms, u
     struct drms_s *p_drms = (struct drms_s *)_p_drms;
     FILE *file;
     int i_ret = -1;
-    char psz_path[ PATH_MAX ];
+    char psz_path[ XMMS_PATH_MAX ];
 
-    sprintf( psz_path, /*PATH_MAX - 1,*/
+    sprintf( psz_path, /*XMMS_PATH_MAX - 1,*/
               "%s/" DRMS_DIRNAME "/%08X.%03d", p_drms->psz_homedir,
               p_drms->i_user, p_drms->i_key );
 
@@ -1030,7 +1030,7 @@ static int GetSCIData( char *psz_ipod, u
 {
     FILE *file;
     char *psz_path = NULL;
-    char p_tmp[ PATH_MAX ];
+    char p_tmp[ XMMS_PATH_MAX ];
     int i_ret = -1;
 
     if( psz_ipod == NULL )
--- xmms2-0.7DrNo.orig/src/xmms/main.c
+++ xmms2-0.7DrNo/src/xmms/main.c
@@ -215,7 +215,7 @@ spawn_script_setup (gpointer data)
 static void
 load_config (void)
 {
-	gchar configdir[PATH_MAX];
+	gchar configdir[XMMS_PATH_MAX];
 
 	if (!conffile) {
 		conffile = XMMS_BUILD_PATH ("xmms2.conf");
@@ -347,7 +347,7 @@ install_scripts (const gchar *into_dir)
 {
 	GDir *dir;
 	GError *err = NULL;
-	gchar path[PATH_MAX];
+	gchar path[XMMS_PATH_MAX];
 	const gchar *f;
 	gchar *s;
 
@@ -357,7 +357,7 @@ install_scripts (const gchar *into_dir)
 
 	s++;
 
-	g_snprintf (path, PATH_MAX, "%s/scripts/%s", SHAREDDIR, s);
+	g_snprintf (path, XMMS_PATH_MAX, "%s/scripts/%s", SHAREDDIR, s);
 	xmms_log_info ("Installing scripts from %s", path);
 	dir = g_dir_open (path, 0, &err);
 	if (!dir) {
--- xmms2-0.7DrNo.orig/src/xmms/utils.c
+++ xmms2-0.7DrNo/src/xmms/utils.c
@@ -38,12 +38,12 @@ char *
 xmms_build_path (const char *first, ...)
 {
 	va_list ap;
-	gchar confdir[PATH_MAX];
+	gchar confdir[XMMS_PATH_MAX];
 	gchar *ret, **vargv, **argv;
 
 	g_return_val_if_fail (first, NULL);
 
-	xmms_userconfdir_get (confdir, PATH_MAX);
+	xmms_userconfdir_get (confdir, XMMS_PATH_MAX);
 
 	va_start (ap, first);
 	vargv = xmms_valist_to_strlist (first, ap);