public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/xfig] epel10.2: - Fix Text size field inserts characters on left instead of right (#490257)
@ 2026-05-30 14:28 Hans de Goede
  0 siblings, 0 replies; only message in thread
From: Hans de Goede @ 2026-05-30 14:28 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/xfig
            Branch : epel10.2
            Commit : 8b23145fcb03d25ec8a166a39345f54b65181ce0
            Author : Hans de Goede <jwrdegoede@fedoraproject.org>
            Date   : 2009-03-15T15:34:17+00:00
            Stats  : +88/-1 in 3 file(s)
            URL    : https://src.fedoraproject.org/rpms/xfig/c/8b23145fcb03d25ec8a166a39345f54b65181ce0?branch=epel10.2

            Log:
            - Fix Text size field inserts characters on left instead of right (#490257)
- Fix xfig-Xaw3d does not display messages in message panel (#490259)

---
diff --git a/xfig-3.2.5-rh490257.patch b/xfig-3.2.5-rh490257.patch
new file mode 100644
index 0000000..7c193b8
--- /dev/null
+++ b/xfig-3.2.5-rh490257.patch
@@ -0,0 +1,59 @@
+--- xfig.3.2.5/w_util.c	2007-01-16 18:58:18.000000000 +0100
++++ xfig.3.2.5.wip/w_util.c	2009-03-15 13:31:47.000000000 +0100
+@@ -932,21 +932,23 @@
+     DeclareArgs(4);
+     spin_struct *spins = (spin_struct*) info;
+     char	buf[200];
+-    int		val, i, pos;
++    int		val, i, modified = 0;
++    XawTextPosition pos;
+ 
+     /* save cursor position */
+     FirstArg(XtNinsertPosition, &pos);
+     GetValues(spins->widget);
+ 
+-    buf[sizeof(buf)-1]='\0';
+-    strncpy(buf,panel_get_value(spins->widget),sizeof(buf));
++    snprintf(buf, sizeof(buf), "%s", panel_get_value(spins->widget));
++
+     for (i=0; i<strlen(buf); )
+ 	/* delete any non-digits (including leading "-" when min >= 0 */
+ 	if ((spins->min >= 0.0 && buf[i] == '-') || ((buf[i] < '0' || buf[i] > '9') && buf[i] != '-') || 
+ 			(i != 0 && buf[i] == '-')) {
+-	    strcpy(&buf[i],&buf[i+1]);
++	    memmove(&buf[i], &buf[i+1], strlen(&buf[i]));
+ 	    /* adjust cursor for char we just removed */
+ 	    pos--;
++	    modified = 1;
+ 	} else {
+ 	    i++;
+ 	}
+@@ -954,15 +956,21 @@
+     if (strlen(buf) > 0 && !(strlen(buf)==1 && buf[0] == '-')) {
+ 	val = atoi(buf);
+ 	/* only check max.  If min is, say 3 and user wants to type 10, the 1 is too small */
+-	if (val > (int) spins->max)
++	if (val > (int) spins->max) {
+ 	    val = (int) spins->max;
+-	sprintf(buf,"%d", val);
++	    sprintf(buf,"%d", val);
++	    modified = 1;
++        }
+     }
+-    panel_set_value(spins->widget, buf);
+-    /* put cursor back */
+-    if (pos < strlen(buf)) {
+-	FirstArg(XtNinsertPosition, pos+1);
+-	SetValues(spins->widget);
++
++    if (modified) {
++        panel_set_value(spins->widget, buf);
++
++	/* put cursor back */
++	if (pos < strlen(buf)) {
++	    FirstArg(XtNinsertPosition, (pos+1));
++	    SetValues(spins->widget);
++	}
+     }
+ }
+ 

diff --git a/xfig-3.2.5-rh490259.patch b/xfig-3.2.5-rh490259.patch
new file mode 100644
index 0000000..4b50498
--- /dev/null
+++ b/xfig-3.2.5-rh490259.patch
@@ -0,0 +1,20 @@
+--- xfig.3.2.5/w_msgpanel.c	2005-07-26 18:40:01.000000000 +0200
++++ xfig.3.2.5.xaw3d/w_msgpanel.c	2009-03-15 16:13:31.000000000 +0100
+@@ -85,13 +85,15 @@
+ init_msg(Widget tool)
+ {
+     /* now the message panel */
+-    FirstArg(XtNfont, roman_font);
+-    FirstArg(XtNwidth, MSGPANEL_WD);
++    FirstArg(XtNfont, roman_font);
++    NextArg(XtNwidth, MSGPANEL_WD);
+     NextArg(XtNheight, MSGPANEL_HT);
+     NextArg(XtNstring, "\0");
+     NextArg(XtNfromVert, cmd_form);
+     NextArg(XtNvertDistance, -INTERNAL_BW);
+     NextArg(XtNborderWidth, INTERNAL_BW);
++    NextArg(XtNtopMargin, 1);
++    NextArg(XtNbottomMargin, 1);
+     NextArg(XtNdisplayCaret, False);
+     NextArg(XtNtop, XtChainTop);
+     NextArg(XtNbottom, XtChainTop);

diff --git a/xfig.spec b/xfig.spec
index 4ed4000..c9f9e5d 100644
--- a/xfig.spec
+++ b/xfig.spec
@@ -3,7 +3,7 @@
 Summary: An X Window System tool for drawing basic vector graphics
 Name: xfig
 Version: 3.2.5
-Release: 15%{?dist}
+Release: 16%{?dist}
 License: MIT
 Group: Applications/Multimedia
 URL: http://www.xfig.org/
@@ -24,6 +24,8 @@ Patch13: xfig-3.2.5-urwfonts.patch
 Patch14: xfig-3.2.5-zoom-crash.patch
 Patch15: xfig-3.2.5-missing-protos.patch
 Patch16: xfig-3.2.5-modepanel.patch
+Patch17: xfig-3.2.5-rh490257.patch
+Patch18: xfig-3.2.5-rh490259.patch
 
 BuildRequires: libjpeg-devel
 BuildRequires: libpng-devel
@@ -101,6 +103,8 @@ Files common to both the plain Xaw and the Xaw3d version of xfig.
 %patch14 -p1 -b .zoom-crash
 %patch15 -p1
 %patch16 -p1
+%patch17 -p1
+%patch18 -p1
 ln -nfs Doc/xfig.man xfig.man
 find -type f -print0 | xargs -0 chmod -x
 sed -i.save 's/\r//g' Doc/html/index.html
@@ -198,6 +202,10 @@ fi
 
 
 %changelog
+* Sun Mar 15 2009 Hans de Goede <hdegoede@redhat.com> 3.2.5-16
+- Fix Text size field inserts characters on left instead of right (#490257)
+- Fix xfig-Xaw3d does not display messages in message panel (#490259)
+
 * Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.2.5-15
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-05-30 14:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-05-30 14:28 [rpms/xfig] epel10.2: - Fix Text size field inserts characters on left instead of right (#490257) Hans de Goede

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox