[xscreensaver/f17] xscreensaver-demo should not truncate http:// to http:/
Mamoru Tasaka
mtasaka at fedoraproject.org
Tue Jun 12 11:58:02 UTC 2012
commit d58262bdef0c43946b9ee79f488b6ab80c3c1235
Author: Mamoru Tasaka <tasaka1 at localhost.localdomain>
Date: Tue Jun 12 20:57:58 2012 +0900
xscreensaver-demo should not truncate http:// to http:/
Also suppress warning for http:// on xscreensaver-demo
(partial fix for bug 827771)
...eensaver-5.15-feedurl-doubleslash-warning.patch | 69 ++++++++++++++++++++
xscreensaver.spec | 12 +++-
2 files changed, 80 insertions(+), 1 deletions(-)
---
diff --git a/xscreensaver-5.15-feedurl-doubleslash-warning.patch b/xscreensaver-5.15-feedurl-doubleslash-warning.patch
new file mode 100644
index 0000000..737aa05
--- /dev/null
+++ b/xscreensaver-5.15-feedurl-doubleslash-warning.patch
@@ -0,0 +1,69 @@
+--- xscreensaver-5.15/driver/demo-Gtk.c.feedurl 2011-05-15 11:38:09.000000000 +0900
++++ xscreensaver-5.15/driver/demo-Gtk.c 2012-06-12 18:39:04.951825510 +0900
+@@ -1412,19 +1412,34 @@
+ {
+ s0--;
+ s += 3;
+- strcpy (s0, s);
++ /* strcpy (s0, s); */
++ memmove(s0, s, strlen(s) + 1);
+ s = s0-1;
+ }
+ }
+- else if (*s == '/' && !strncmp (s, "/./", 3)) /* delete "/./" */
+- strcpy (s, s+2), s--;
++ else if (*s == '/' && !strncmp (s, "/./", 3)) { /* delete "/./" */
++ /* strcpy (s, s+2), s--; */
++ memmove(s, s+2, strlen(s+1) + 1);
++ }
+ else if (*s == '/' && !strncmp (s, "/.\000", 3)) /* delete "/.$" */
+ *s = 0, s--;
+ }
+
+- for (s = p2; s && *s; s++) /* normalize consecutive slashes */
+- while (s[0] == '/' && s[1] == '/')
+- strcpy (s, s+1);
++ /*
++ Normalize consecutive slashes.
++ As xscreensaver-getimage ought to support the URL of an RSS or Atom feed,
++ this should not change http:// .
++
++ strcpy does not allow buffers' overlap.
++ */
++
++ for (s = p2; s && *s; s++){
++ if (*s == ':') continue;
++ if (!s[1] || !s[2]) continue;
++ while (s[1] == '/' && s[2] == '/')
++ /* strcpy (s+1, s+2); */
++ memmove (s+1, s+2, strlen(s+2) + 1);
++ }
+
+ /* and strip trailing whitespace for good measure. */
+ L = strlen(p2);
+@@ -1593,10 +1608,13 @@
+ /* Warn if the image directory doesn't exist, when:
+ - not being warned before
+ - image directory is changed and the directory doesn't exist
++ - image directory does not begin with http://
++ (xscreensaver-getimage ought to support this)
+ */
+ if (p2->image_directory &&
+ *p2->image_directory &&
+ !directory_p (p2->image_directory) &&
++ strncmp(p2->image_directory, "http://", 6) &&
+ ( !already_warned_about_missing_image_directory ||
+ ( p->image_directory &&
+ *p->image_directory &&
+@@ -2066,7 +2084,10 @@
+ if (p->image_directory && !strcmp(p->image_directory, path))
+ return; /* no change */
+
+- if (!directory_p (path))
++ /* If the directory name begins with http://, let's not warn
++ this because xscreensaver-getimage ought to support
++ */
++ if ((!directory_p (path)) && strncmp(path, "http://", 6))
+ {
+ char b[255];
+ sprintf (b, _("Error:\n\n" "Directory does not exist: \"%s\"\n"), path);
diff --git a/xscreensaver.spec b/xscreensaver.spec
index f46d42c..d7d2a9c 100644
--- a/xscreensaver.spec
+++ b/xscreensaver.spec
@@ -10,7 +10,7 @@
%define split_getimage 1
%endif
-%define fedora_rel 6
+%define fedora_rel 7
%undefine extrarel
@@ -72,6 +72,10 @@ Patch33: xscreensaver-5.15-webcollage-chomp-getimagefile.patch
Patch34: xscreensaver-5.15-vidwhacker-with-relative-path.patch
# With -pair option, quitting hack will cause segv (bug 819349)
Patch35: xscreensaver-5.15-pair-quit-segv.patch
+# xscreensaver-demo should not truncate http:// to http:/
+# also xscreensaver-demo should not warn for http://
+# (partial fix for bug 827771)
+Patch36: xscreensaver-5.15-feedurl-doubleslash-warning.patch
#
# driver/test-passwd tty segfaults
Patch41: xscreensaver-5.12-test-passwd-segv-tty.patch
@@ -269,6 +273,7 @@ This package contains some test programs to debug XScreenSaver.
%patch33 -p1 -b .chomp
%patch34 -p1 -b .relative
%patch35 -p1 -b .pair
+%patch36 -p1 -b .feedurl
%patch41 -p1 -b .test_passwd
%patch42 -p1 -b .test_misc
@@ -797,6 +802,11 @@ exit 0
%defattr(-,root,root,-)
%changelog
+* Tue Jun 12 2012 Mamoru Tasaka <mtasaka at fedoraproject.org> - 1:5.15-7
+- xscreensaver-demo should not truncate http:// to http:/
+ Also suppress warning for http:// on xscreensaver-demo
+ (partial fix for bug 827771)
+
* Mon May 7 2012 Mamoru Tasaka <mtasaka at fedoraproject.org> - 1:5.15-6
- Fix segv when quitting hack with -pair option (bug 819349)
More information about the scm-commits
mailing list