gnome-panel r11187 - trunk/gnome-panel



Author: vuntz
Date: Mon Aug  4 02:48:56 2008
New Revision: 11187
URL: http://svn.gnome.org/viewvc/gnome-panel?rev=11187&view=rev

Log:
2008-08-04  Vincent Untz  <vuntz gnome org>

	* panel-util.c: (panel_make_unique_desktop_path_from_name): go back to
	NAME_MAX instead of MAXNAMLEN since the former is POSIX and not all OS
	have MAXNAMLEN either. Since we have to be compatible with all OS out
	there, use MAXNAMLEN if NAME_MAX is not defined on the OS.
	Fix bug #500341.


Modified:
   trunk/gnome-panel/ChangeLog
   trunk/gnome-panel/panel-util.c

Modified: trunk/gnome-panel/panel-util.c
==============================================================================
--- trunk/gnome-panel/panel-util.c	(original)
+++ trunk/gnome-panel/panel-util.c	Mon Aug  4 02:48:56 2008
@@ -758,7 +758,15 @@
 {
 	int   num = 1;
 	char *path = NULL;
-	char  filename[MAXNAMLEN];
+#ifndef NAME_MAX
+/* sigh: some OS don't have NAME_MAX (which is POSIX). */
+#ifdef MAXNAMLEN
+#define NAME_MAX MAXNAMLEN
+#else
+#define NAME_MAX 255
+#endif
+#endif
+	char  filename[NAME_MAX];
 
 /* g_file_set_contents() use "%s.XXXXXX"
  * FIXME: waiting for http://bugzilla.gnome.org/show_bug.cgi?id=437977 */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]