Module Name:    xsrc
Committed By:   mrg
Date:           Thu Jul  4 00:58:16 UTC 2024

Modified Files:
        xsrc/external/mit/xlsfonts/dist: xlsfonts.c
        xsrc/external/mit/xmh/include: config.h
        xsrc/external/mit/xsm/dist: choose.c
Removed Files:
        xsrc/external/mit/xorg-docs/dist: README compile
        xsrc/external/mit/xorg-docs/dist/specs/Xext: Makefile.am Makefile.in
            lbxalg.xml

Log Message:
merge xlsfonts 1.0.8, xmh 1.0.5, xorg-docs 1.7.3, and xsm 1.0.6.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 xsrc/external/mit/xlsfonts/dist/xlsfonts.c
cvs rdiff -u -r1.1 -r1.2 xsrc/external/mit/xmh/include/config.h
cvs rdiff -u -r1.1.1.1 -r0 xsrc/external/mit/xorg-docs/dist/README \
    xsrc/external/mit/xorg-docs/dist/compile
cvs rdiff -u -r1.1.1.1 -r0 \
    xsrc/external/mit/xorg-docs/dist/specs/Xext/Makefile.am \
    xsrc/external/mit/xorg-docs/dist/specs/Xext/lbxalg.xml
cvs rdiff -u -r1.1.1.2 -r0 \
    xsrc/external/mit/xorg-docs/dist/specs/Xext/Makefile.in
cvs rdiff -u -r1.4 -r1.5 xsrc/external/mit/xsm/dist/choose.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: xsrc/external/mit/xlsfonts/dist/xlsfonts.c
diff -u xsrc/external/mit/xlsfonts/dist/xlsfonts.c:1.3 xsrc/external/mit/xlsfonts/dist/xlsfonts.c:1.4
--- xsrc/external/mit/xlsfonts/dist/xlsfonts.c:1.3	Mon Jul 11 08:42:43 2022
+++ xsrc/external/mit/xlsfonts/dist/xlsfonts.c	Thu Jul  4 00:58:15 2024
@@ -36,6 +36,14 @@ in this Software without prior written a
 #include <limits.h>
 #include "dsimple.h"
 
+#ifdef HAVE_BSD_STDLIB_H
+#include <bsd/stdlib.h>
+#endif
+
+#ifndef HAVE_REALLOCARRAY
+#define reallocarray(old, num, size) realloc(old, (num) * (size))
+#endif
+
 #define N_START INT_MAX         /* Maximum # of fonts to start with (should
                                  * always be be > 10000 as modern OSes like
                                  * Solaris 8 already have more than 9000 XLFD
@@ -58,7 +66,7 @@ static int  font_cnt                  = 
 static int  min_max;
 
 typedef struct {
-    char *name;
+    const char *name;
     XFontStruct *info;
 } FontList;
 
@@ -73,7 +81,7 @@ static int  IgnoreError(Display *disp, X
 static void PrintProperty(XFontProp *prop);
 static void ComputeFontType(XFontStruct *fs);
 static void print_character_metrics(register XFontStruct *info);
-static void do_query_font(Display *dpy, char *name);
+static void do_query_font(Display *dpy, const char *name);
 
 void
 usage(const char *errmsg)
@@ -191,57 +199,70 @@ main(int argc, char **argv)
 static void
 get_list(const char *pattern)
 {
-    int available = nnames + 1, i;
-    char **fonts;
     XFontStruct *info;
 
-    /* Get list of fonts matching pattern */
-    for (;;) {
-        if (open_instead_of_list) {
-            info = XLoadQueryFont(dpy, pattern);
-
-            if (info) {
-                fonts = __UNCONST(&pattern);
-                available = 1;
-                XUnloadFont(dpy, info->fid);
-            }
-            else {
-                fonts = NULL;
-            }
-            break;
-        }
-
-        if (long_list == L_MEDIUM)
-            fonts = XListFontsWithInfo(dpy, pattern, nnames, &available, &info);
-        else
-            fonts = XListFonts(dpy, pattern, nnames, &available);
-        if (fonts == NULL || available < nnames)
-            break;
-        if (long_list == L_MEDIUM)
-            XFreeFontInfo(fonts, info, available);
-        else
-            XFreeFontNames(fonts);
-        nnames = available * 2;
-    }
-
-    if (fonts == NULL) {
-        fprintf(stderr, "%s: pattern \"%s\" unmatched\n",
-                program_name, pattern);
-        return;
-    }
+    if (open_instead_of_list) {
+        info = XLoadQueryFont(dpy, pattern);
 
-    font_list = realloc(font_list, (font_cnt + available) * sizeof(FontList));
-    if (font_list == NULL)
-        Fatal_Error("Out of memory!");
-    for (i = 0; i < available; i++) {
-        font_list[font_cnt].name = fonts[i];
-        if (long_list == L_MEDIUM)
-            font_list[font_cnt].info = info + i;
-        else
+        if (info == NULL) {
+            fprintf(stderr, "%s: pattern \"%s\" unmatched\n",
+                    program_name, pattern);
+            return;
+        }
+
+        font_list = reallocarray(font_list, (font_cnt + 1), sizeof(FontList));
+        if (font_list == NULL)
+            Fatal_Error("Out of memory!");
+        font_list[font_cnt].name = pattern;
+        if (long_list == L_MEDIUM) {
+            font_list[font_cnt].info = info;
+            XUnloadFont(dpy, info->fid);
+        }
+        else {
             font_list[font_cnt].info = NULL;
-
+            XFreeFont(dpy, info);
+        }
         font_cnt++;
     }
+    else {
+        /* Get list of fonts matching pattern */
+        int available = nnames + 1;
+        char **fonts;
+
+        for (;;) {
+            if (long_list == L_MEDIUM)
+                fonts = XListFontsWithInfo(dpy, pattern, nnames, &available,
+                                           &info);
+            else
+                fonts = XListFonts(dpy, pattern, nnames, &available);
+            if (fonts == NULL) {
+                fprintf(stderr, "%s: pattern \"%s\" unmatched\n",
+                        program_name, pattern);
+                return;
+            }
+            if (available < nnames)
+                break;
+            if (long_list == L_MEDIUM)
+                XFreeFontInfo(fonts, info, available);
+            else
+                XFreeFontNames(fonts);
+            nnames = available * 2;
+        }
+
+        font_list = reallocarray(font_list,
+                                 (font_cnt + available), sizeof(FontList));
+        if (font_list == NULL)
+            Fatal_Error("Out of memory!");
+        for (int i = 0; i < available; i++) {
+            font_list[font_cnt].name = fonts[i];
+            if (long_list == L_MEDIUM)
+                font_list[font_cnt].info = info + i;
+            else
+                font_list[font_cnt].info = NULL;
+
+            font_cnt++;
+        }
+    }
 }
 
 static int
@@ -625,7 +646,7 @@ print_character_metrics(register XFontSt
 }
 
 static void
-do_query_font(Display *display, char *name)
+do_query_font(Display *display, const char *name)
 {
     register int i;
     register XFontStruct *info = XLoadQueryFont(display, name);

Index: xsrc/external/mit/xmh/include/config.h
diff -u xsrc/external/mit/xmh/include/config.h:1.1 xsrc/external/mit/xmh/include/config.h:1.2
--- xsrc/external/mit/xmh/include/config.h:1.1	Sat Nov 20 23:25:26 2010
+++ xsrc/external/mit/xmh/include/config.h	Thu Jul  4 00:58:15 2024
@@ -38,7 +38,7 @@
 #define PACKAGE_NAME "xmh"
 
 /* Define to the full name and version of this package. */
-#define PACKAGE_STRING "xmh 1.0.2"
+#define PACKAGE_STRING "xmh 1.0.5"
 
 /* Define to the one symbol short name of this package. */
 #define PACKAGE_TARNAME "xmh"
@@ -47,7 +47,7 @@
 #define PACKAGE_URL ""
 
 /* Define to the version of this package. */
-#define PACKAGE_VERSION "1.0.2"
+#define PACKAGE_VERSION "1.0.5"
 
 /* Major version of this package */
 #define PACKAGE_VERSION_MAJOR 1
@@ -56,10 +56,10 @@
 #define PACKAGE_VERSION_MINOR 0
 
 /* Patch version of this package */
-#define PACKAGE_VERSION_PATCHLEVEL 2
+#define PACKAGE_VERSION_PATCHLEVEL 5
 
 /* Define to 1 if you have the ANSI C header files. */
 #define STDC_HEADERS 1
 
 /* Version number of package */
-#define VERSION "1.0.2"
+#define VERSION "1.0.5"

Index: xsrc/external/mit/xsm/dist/choose.c
diff -u xsrc/external/mit/xsm/dist/choose.c:1.4 xsrc/external/mit/xsm/dist/choose.c:1.5
--- xsrc/external/mit/xsm/dist/choose.c:1.4	Mon Jul 11 19:41:08 2022
+++ xsrc/external/mit/xsm/dist/choose.c	Thu Jul  4 00:58:15 2024
@@ -39,19 +39,11 @@ in this Software without prior written a
 #ifndef X_NOT_POSIX
 #include <dirent.h>
 #else
-#ifdef SYSV
-#include <dirent.h>
-#else
-#ifdef USG
-#include <dirent.h>
-#else
 #include <sys/dir.h>
 #ifndef dirent
 #define dirent direct
 #endif
 #endif
-#endif
-#endif
 
 static Pixel save_message_foreground;
 static Pixel save_message_background;

Reply via email to