>From 019b97b10e0b8a88db1a98ad854fb934871170be Mon Sep 17 00:00:00 2001
From: Tamas TEVESZ <[email protected]>
Date: Thu, 18 Mar 2010 00:51:33 +0100
Subject: [PATCH] Feet protector for getstyle

Since getstyle now saves the theme pack in $GUR instead of
the cwd, there's a slight possibility you can specify a theme
pack name that will do Bad Things to your existing stuff.

To that end, specified theme pack name is "sanitised" a bit, as in
forward slashes in it are replaced by an underscore.

Oh yes, i forgot to mention. getstyle now saves the theme pack
in $GNUSTEP_USER_ROOT, not in cwd.
---
 util/getstyle.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/util/getstyle.c b/util/getstyle.c
index 271ce22..d84e812 100644
--- a/util/getstyle.c
+++ b/util/getstyle.c
@@ -352,7 +352,7 @@ void makeThemePack(WMPropList * style, char *themeName)
 int main(int argc, char **argv)
 {
        WMPropList *prop, *style, *key, *val;
-       char *path;
+       char *path, *p;
        int i, theme_too = 0, make_pack = 0;
        char *style_file = NULL;
 
@@ -379,6 +379,8 @@ int main(int argc, char **argv)
                                        exit(1);
                                }
                                style_file = argv[i];
+                               while ((p = strchr(style_file, '/')) != NULL)
+                                       *p = '_';
                        }
                }
        }
-- 
1.7.0


-- 
[-]

mkdir /nonexistent
From 019b97b10e0b8a88db1a98ad854fb934871170be Mon Sep 17 00:00:00 2001
From: Tamas TEVESZ <[email protected]>
Date: Thu, 18 Mar 2010 00:51:33 +0100
Subject: [PATCH] Feet protector for getstyle

Since getstyle now saves the theme pack in $GUR instead of
the cwd, there's a slight possibility you can specify a theme
pack name that will do Bad Things to your existing stuff.

To that end, specified theme pack name is "sanitised" a bit, as in
forward slashes in it are replaced by an underscore.

Oh yes, i forgot to mention. getstyle now saves the theme pack
in $GNUSTEP_USER_ROOT, not in cwd.
---
 util/getstyle.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/util/getstyle.c b/util/getstyle.c
index 271ce22..d84e812 100644
--- a/util/getstyle.c
+++ b/util/getstyle.c
@@ -352,7 +352,7 @@ void makeThemePack(WMPropList * style, char *themeName)
 int main(int argc, char **argv)
 {
 	WMPropList *prop, *style, *key, *val;
-	char *path;
+	char *path, *p;
 	int i, theme_too = 0, make_pack = 0;
 	char *style_file = NULL;
 
@@ -379,6 +379,8 @@ int main(int argc, char **argv)
 					exit(1);
 				}
 				style_file = argv[i];
+				while ((p = strchr(style_file, '/')) != NULL)
+					*p = '_';
 			}
 		}
 	}
-- 
1.7.0

Reply via email to