SHA256
1
0
forked from pool/emacs
OBS User unknown 2007-05-17 09:30:45 +00:00 committed by Git OBS Bridge
parent 18ddeb85e1
commit 562c054c2c
3 changed files with 82 additions and 1 deletions

72
emacs-21.3-format1.dif Normal file
View File

@ -0,0 +1,72 @@
--- src/lisp.h
+++ src/lisp.h 2007-05-15 13:43:33.195341769 +0000
@@ -2402,7 +2402,11 @@ EXFUN (Fbolp, 0);
EXFUN (Fbobp, 0);
EXFUN (Fformat, MANY);
EXFUN (Fmessage, MANY);
+#ifdef NO_ARG_ARRAY
extern Lisp_Object format1 P_ ((/* char *, ... */));
+#else
+extern Lisp_Object format1 P_ ((char *, ...));
+#endif
extern Lisp_Object make_buffer_string P_ ((int, int, int));
EXFUN (Fbuffer_substring, 2);
EXFUN (Fbuffer_string, 0);
--- src/editfns.c
+++ src/editfns.c 2007-05-15 13:41:46.023982028 +0000
@@ -20,6 +20,7 @@ the Free Software Foundation, Inc., 59 T
Boston, MA 02111-1307, USA. */
+#include <stdarg.h>
#include <config.h>
#include <sys/types.h>
@@ -3517,11 +3518,11 @@ Use %% to put a single % into the output
Lisp_Object
#ifdef NO_ARG_ARRAY
format1 (string1, arg0, arg1, arg2, arg3, arg4)
+ char *string1;
EMACS_INT arg0, arg1, arg2, arg3, arg4;
#else
-format1 (string1)
+format1 (char *string1, ...)
#endif
- char *string1;
{
char buf[100];
#ifdef NO_ARG_ARRAY
@@ -3533,7 +3534,32 @@ format1 (string1)
args[4] = arg4;
doprnt (buf, sizeof buf, string1, (char *)0, 5, (char **) args);
#else
- doprnt (buf, sizeof buf, string1, (char *)0, 5, &string1 + 1);
+ const char *fmt = string1;
+ int nargs = 0;
+ long args[5];
+ va_list ap;
+
+ va_start(ap, string1);
+ while (*fmt && nargs < 5) {
+ if (*fmt++ == '%') {
+ void *va = NULL;
+ switch (*fmt) {
+ case 's':
+ va = (void*)va_arg(ap, char*);
+ break;
+ case 'd':
+ case 'c':
+ va = (void*)va_arg(ap, int);
+ break;
+ default:
+ break;
+ }
+ if (va)
+ args[nargs++] = (long)va;
+ }
+ }
+ va_end(ap);
+ doprnt (buf, sizeof buf, string1, string1 + strlen(string1), nargs, (char **)args);
#endif
return build_string (buf);
}

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Tue May 15 15:54:22 CEST 2007 - werner@suse.de
- Use stdarg(3) instead of guessing argument pointers (bug #273211)
-------------------------------------------------------------------
Thu Mar 29 19:59:08 CEST 2007 - aj@suse.de

View File

@ -20,7 +20,7 @@ Requires: emacs-info ctags emacs_program
Provides: ge_site ge_exec
Autoreqprov: on
Version: 21.3
Release: 268
Release: 279
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Summary: GNU Emacs Base Package
Source: emacs-21.3.tar.bz2
@ -48,6 +48,7 @@ Patch17: emacs-21.3-level3.patch
Patch18: emacs-21.3-movemail.patch
Patch19: emacs-21.3-sentinel.patch
Patch20: emacs-21.3-xim.patch
Patch21: emacs-21.3-format1.dif
%{expand: %%global _exec_prefix %(type -p pkg-config &>/dev/null && pkg-config --variable prefix x11 || echo /usr/X11R6)}
%if "%_exec_prefix" == "/usr/X11R6"
%define _x11lib %{_exec_prefix}/%{_lib}
@ -219,6 +220,7 @@ Authors:
%patch18 -p1 -b .movemail
%patch19 -p0 -b .gcc4
%patch20 -p0 -b .xim
%patch21 -p0 -b .fmt1
%patch
%patch12 -p0 -b .ppc
@ -2398,6 +2400,8 @@ done
/usr/share/emacs/%{version}/lisp/xt-mouse.el
%changelog
* Tue May 15 2007 - werner@suse.de
- Use stdarg(3) instead of guessing argument pointers (bug #273211)
* Thu Mar 29 2007 - aj@suse.de
- Add ncurses-devel to BuildRequires.
* Fri Jan 12 2007 - werner@suse.de