Hello community, here is the log from the commit of package mkfontscale for openSUSE:Factory checked in at 2015-02-06 10:19:10 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/mkfontscale (Old) and /work/SRC/openSUSE:Factory/.mkfontscale.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "mkfontscale" Changes: -------- --- /work/SRC/openSUSE:Factory/mkfontscale/mkfontscale.changes 2013-08-19 13:30:04.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.mkfontscale.new/mkfontscale.changes 2015-02-06 10:19:11.000000000 +0100 @@ -1,0 +2,16 @@ +Mon Feb 2 23:53:41 UTC 2015 - [email protected] + +- Update to version 1.1.2: + + Remove extraneous duplicate checks for -r & -n options. + + autogen.sh: Honor NOCONFIGURE=1. + + configure: Drop AM_MAINTAINER_MODE. + + Only include config.h if it exists. + + Fix possible malloc allocation error found by clang static + analysis. + + Plug a memory leak found by clang static analysis. + + Print which option was in error along with usage message. + + Make usage() always exit(1). + + Add -v flag to print program version. + + Add missing newline to usage output. + +------------------------------------------------------------------- Old: ---- mkfontscale-1.1.1.tar.bz2 New: ---- mkfontscale-1.1.2.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ mkfontscale.spec ++++++ --- /var/tmp/diff_new_pack.lNqHof/_old 2015-02-06 10:19:11.000000000 +0100 +++ /var/tmp/diff_new_pack.lNqHof/_new 2015-02-06 10:19:11.000000000 +0100 @@ -1,7 +1,7 @@ # # spec file for package mkfontscale # -# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: mkfontscale -Version: 1.1.1 +Version: 1.1.2 Release: 0 Summary: Utility to create index of scalable font files for X License: MIT @@ -29,7 +29,7 @@ BuildRequires: pkgconfig(fontenc) BuildRequires: pkgconfig(freetype2) BuildRequires: pkgconfig(xorg-macros) >= 1.8 -BuildRequires: pkgconfig(xproto) +BuildRequires: pkgconfig(xproto) >= 7.0.25 # This was part of the xorg-x11 package up to version 7.6 Conflicts: xorg-x11 <= 7.6 BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -40,7 +40,6 @@ %prep %setup -q -##%%patch0 -p1 %build %configure ++++++ mkfontscale-1.1.1.tar.bz2 -> mkfontscale-1.1.2.tar.bz2 ++++++ ++++ 4204 lines of diff (skipped) ++++ retrying with extended exclude list diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/mkfontscale-1.1.1/ChangeLog new/mkfontscale-1.1.2/ChangeLog --- old/mkfontscale-1.1.1/ChangeLog 2013-07-17 07:53:19.000000000 +0200 +++ new/mkfontscale-1.1.2/ChangeLog 2015-01-17 08:41:09.000000000 +0100 @@ -1,3 +1,118 @@ +commit 87d628f8eec170ec13bb9feefb1ce05aed07d1d6 +Author: Alan Coopersmith <[email protected]> +Date: Fri Jan 16 23:40:40 2015 -0800 + + mkfontscale 1.1.2 + + Signed-off-by: Alan Coopersmith <[email protected]> + +commit 47908fd7a0d061fdcd21e3498da4e223ca9136d9 +Author: Alan Coopersmith <[email protected]> +Date: Fri Jun 20 23:23:54 2014 -0700 + + Remove extraneous duplicate checks for -r & -n options + + Flagged by cppcheck 1.65: + [mkfontscale.c:247]: (style) Expression is always false because + 'else if' condition matches previous condition at line 224. + [mkfontscale.c:245]: (style) Expression is always false because + 'else if' condition matches previous condition at line 227. + + Signed-off-by: Alan Coopersmith <[email protected]> + Reviewed-by: Hans de Goede <[email protected]> + +commit 48e541dc2f2fc3f4e99d3e168c28241ff5adff4d +Author: Alan Coopersmith <[email protected]> +Date: Mon Jun 2 19:39:49 2014 -0700 + + autogen.sh: Honor NOCONFIGURE=1 + + See http://people.gnome.org/~walters/docs/build-api.txt + + Signed-off-by: Alan Coopersmith <[email protected]> + +commit f14019d598c215e09cff88c739bbf7f4d6c6b89f +Author: Alan Coopersmith <[email protected]> +Date: Mon Jun 2 19:39:49 2014 -0700 + + configure: Drop AM_MAINTAINER_MODE + + Signed-off-by: Alan Coopersmith <[email protected]> + +commit 399db42a151687f1181ae23d28a76d31125a2853 +Author: Thomas Klausner <[email protected]> +Date: Tue Mar 18 23:14:47 2014 +0100 + + Only include config.h if it exists. + + Reviewed-by: Gaetan Nadon <[email protected]> + Signed-off-by: Thomas Klausner <[email protected]> + +commit eac564e0fc9052a39981ea47b271f7f3d2821944 +Author: Jeremy Huddleston Sequoia <[email protected]> +Date: Thu Jan 2 00:43:14 2014 -0800 + + Fix possible malloc allocation error found by clang static analysis + + list.c:238:23: warning: Call to 'malloc' has an allocation size of 0 bytes + ListPtr *sorted = malloc(l * sizeof(ListPtr)); + ^~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Signed-off-by: Jeremy Huddleston Sequoia <[email protected]> + +commit 423ffbe9c5552dfeffa81bb6e2f2b62ab6b17580 +Author: Jeremy Huddleston Sequoia <[email protected]> +Date: Thu Jan 2 00:39:25 2014 -0800 + + Plug a memory leak found by clang static analysis + + mkfontscale.c:635:25: warning: Potential leak of memory pointed to by 'notice' + foundry = notice_foundry(notice); + ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~ + mkfontscale.c:640:8: warning: Potential leak of memory pointed to by 'notice' + if(strcmp(slant, "i") == 0) { + ^~~~~~ + + Signed-off-by: Jeremy Huddleston Sequoia <[email protected]> + +commit 880a0c4733e62e54e6a0f1238c7430727d23657b +Author: Alan Coopersmith <[email protected]> +Date: Fri Nov 8 23:48:28 2013 -0800 + + Print which option was in error along with usage message + + Signed-off-by: Alan Coopersmith <[email protected]> + Reviewed-by: Gaetan Nadon <[email protected]> + +commit 26c89de6cdf0a5b7122a630a5df37fd67a4163e2 +Author: Alan Coopersmith <[email protected]> +Date: Fri Nov 8 23:28:16 2013 -0800 + + Make usage() always exit(1) + + Avoid duplicating exit(1) calls after every single call to usage() + + Signed-off-by: Alan Coopersmith <[email protected]> + Reviewed-by: Gaetan Nadon <[email protected]> + +commit 43ab9b11699acadbf09b8ed050a7a2f7e630dce4 +Author: Alan Coopersmith <[email protected]> +Date: Fri Nov 8 23:21:32 2013 -0800 + + Add -v flag to print program version + + Signed-off-by: Alan Coopersmith <[email protected]> + Reviewed-by: Gaetan Nadon <[email protected]> + +commit e5788db7f179bf89d2e5e3c97c69058027cb93bd +Author: Alan Coopersmith <[email protected]> +Date: Fri Nov 8 22:56:02 2013 -0800 + + Add missing newline to usage output + + Signed-off-by: Alan Coopersmith <[email protected]> + Reviewed-by: Gaetan Nadon <[email protected]> + commit f48de13423c7300f4da9f61993b624426b38ddc0 Author: Alan Coopersmith <[email protected]> Date: Tue Jul 16 22:50:54 2013 -0700 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/mkfontscale-1.1.1/INSTALL new/mkfontscale-1.1.2/INSTALL --- old/mkfontscale-1.1.1/INSTALL 2013-07-17 07:53:19.000000000 +0200 +++ new/mkfontscale-1.1.2/INSTALL 2015-01-17 08:41:09.000000000 +0100 @@ -1,11 +1,13 @@ Installation Instructions ************************* -Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, -2006, 2007, 2008 Free Software Foundation, Inc. +Copyright (C) 1994-1996, 1999-2002, 2004-2011 Free Software Foundation, +Inc. - This file is free documentation; the Free Software Foundation gives -unlimited permission to copy, distribute and modify it. + Copying and distribution of this file, with or without modification, +are permitted in any medium without royalty provided the copyright +notice and this notice are preserved. This file is offered as-is, +without warranty of any kind. Basic Installation ================== @@ -13,7 +15,11 @@ Briefly, the shell commands `./configure; make; make install' should configure, build, and install this package. The following more-detailed instructions are generic; see the `README' file for -instructions specific to this package. +instructions specific to this package. Some packages provide this +`INSTALL' file but do not implement all of the features documented +below. The lack of an optional feature in a given package is not +necessarily a bug. More recommendations for GNU packages can be found +in *note Makefile Conventions: (standards)Makefile Conventions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses @@ -42,7 +48,7 @@ you want to change it or regenerate `configure' using a newer version of `autoconf'. -The simplest way to compile this package is: + The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. @@ -53,12 +59,22 @@ 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with - the package. + the package, generally using the just-built uninstalled binaries. 4. Type `make install' to install the programs and any data files and - documentation. + documentation. When installing into a prefix owned by root, it is + recommended that the package be configured and built as a regular + user, and only the `make install' phase executed with root + privileges. + + 5. Optionally, type `make installcheck' to repeat any self-tests, but + this time using the binaries in their final installed location. + This target does not install anything. Running this target as a + regular user, particularly if the prior `make install' required + root privileges, verifies that the installation completed + correctly. - 5. You can remove the program binaries and object files from the + 6. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is @@ -67,8 +83,15 @@ all sorts of other programs in order to regenerate files that came with the distribution. - 6. Often, you can also type `make uninstall' to remove the installed - files again. + 7. Often, you can also type `make uninstall' to remove the installed + files again. In practice, not all packages have tested that + uninstallation works correctly, even though it is required by the + GNU Coding Standards. + + 8. Some packages, particularly those that use Automake, provide `make + distcheck', which can by used by developers to test that all other + targets like `make install' and `make uninstall' work correctly. + This target is generally not run by end users. Compilers and Options ===================== @@ -93,7 +116,8 @@ own directory. To do this, you can use GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the -source code in the directory that `configure' is in and in `..'. +source code in the directory that `configure' is in and in `..'. This +is known as a "VPATH" build. With a non-GNU `make', it is safer to compile the package for one architecture at a time in the source code directory. After you have @@ -120,7 +144,8 @@ By default, `make install' installs the package's commands under `/usr/local/bin', include files under `/usr/local/include', etc. You can specify an installation prefix other than `/usr/local' by giving -`configure' the option `--prefix=PREFIX'. +`configure' the option `--prefix=PREFIX', where PREFIX must be an +absolute file name. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you @@ -131,15 +156,46 @@ In addition, if you use an unusual directory layout you can give options like `--bindir=DIR' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories -you can set and what kinds of files go in them. +you can set and what kinds of files go in them. In general, the +default for these options is expressed in terms of `${prefix}', so that +specifying just `--prefix' will affect all of the other directory +specifications that were not explicitly provided. + + The most portable way to affect installation locations is to pass the +correct locations to `configure'; however, many packages provide one or +both of the following shortcuts of passing variable assignments to the +`make install' command line to change installation locations without +having to reconfigure or recompile. + + The first method involves providing an override variable for each +affected directory. For example, `make install +prefix=/alternate/directory' will choose an alternate location for all +directory configuration variables that were expressed in terms of +`${prefix}'. Any directories that were specified during `configure', +but not in terms of `${prefix}', must each be overridden at install +time for the entire installation to be relocated. The approach of +makefile variable overrides for each directory variable is required by +the GNU Coding Standards, and ideally causes no recompilation. +However, some platforms have known limitations with the semantics of +shared libraries that end up requiring recompilation when using this +method, particularly noticeable in packages that use GNU Libtool. + + The second method involves providing the `DESTDIR' variable. For +example, `make install DESTDIR=/alternate/directory' will prepend +`/alternate/directory' before all installation names. The approach of +`DESTDIR' overrides is not required by the GNU Coding Standards, and +does not work on platforms that have drive letters. On the other hand, +it does better at avoiding recompilation issues, and works well even +when some directory options were not specified in terms of `${prefix}' +at `configure' time. + +Optional Features +================= If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. -Optional Features -================= - Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE @@ -152,6 +208,13 @@ you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. + Some packages offer the ability to configure how verbose the +execution of `make' will be. For these packages, running `./configure +--enable-silent-rules' sets the default to minimal output, which can be +overridden with `make V=1'; while running `./configure +--disable-silent-rules' sets the default to verbose, which can be +overridden with `make V=0'. + Particular systems ================== @@ -159,10 +222,15 @@ CC is not installed, it is recommended to use the following options in order to use an ANSI C compiler: - ./configure CC="cc -Ae" + ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" and if that doesn't work, install pre-built binaries of GCC for HP-UX. + HP-UX `make' updates targets which have the same time stamps as +their prerequisites, which makes it generally unusable when shipped +generated files such as `configure' are involved. Use GNU `make' +instead. + On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot parse its `<wchar.h>' header file. The option `-nodtk' can be used as a workaround. If GNU CC is not installed, it is therefore recommended @@ -174,6 +242,16 @@ ./configure CC="cc -nodtk" + On Solaris, don't put `/usr/ucb' early in your `PATH'. This +directory contains several dysfunctional programs; working variants of +these programs are available in `/usr/bin'. So, if you need `/usr/ucb' +in your `PATH', put it _after_ `/usr/bin'. + + On Haiku, software installed for all users goes in `/boot/common', +not `/usr/local'. It is recommended to use the following options: + + ./configure --prefix=/boot/common + Specifying the System Type ========================== @@ -189,7 +267,8 @@ where SYSTEM can have one of these forms: - OS KERNEL-OS + OS + KERNEL-OS See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't @@ -277,7 +356,7 @@ `configure' can determine that directory automatically. `--prefix=DIR' - Use DIR as the installation prefix. *Note Installation Names:: + Use DIR as the installation prefix. *note Installation Names:: for more details, including other options available for fine-tuning the installation locations. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/mkfontscale-1.1.1/compile new/mkfontscale-1.1.2/compile --- old/mkfontscale-1.1.1/compile 2013-07-17 07:51:10.000000000 +0200 +++ new/mkfontscale-1.1.2/compile 2015-01-17 08:40:50.000000000 +0100 @@ -3,7 +3,7 @@ scriptversion=2012-10-14.11; # UTC -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2014 Free Software Foundation, Inc. # Written by Tom Tromey <[email protected]>. # # This program is free software; you can redistribute it and/or modify diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/mkfontscale-1.1.1/configure.ac new/mkfontscale-1.1.2/configure.ac --- old/mkfontscale-1.1.1/configure.ac 2013-07-17 07:51:03.000000000 +0200 +++ new/mkfontscale-1.1.2/configure.ac 2015-01-17 08:40:45.000000000 +0100 @@ -22,7 +22,7 @@ # Initialize Autoconf AC_PREREQ([2.60]) -AC_INIT([mkfontscale], [1.1.1], +AC_INIT([mkfontscale], [1.1.2], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [mkfontscale]) AC_CONFIG_SRCDIR([Makefile.am]) @@ -31,7 +31,6 @@ # Initialize Automake AM_INIT_AUTOMAKE([foreign dist-bzip2]) -AM_MAINTAINER_MODE # Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS m4_ifndef([XORG_MACROS_VERSION], @@ -54,7 +53,7 @@ # Checks for pkg-config packages PKG_CHECK_MODULES(MKFONTSCALE, fontenc freetype2) -PKG_CHECK_MODULES(X11, xproto) +PKG_CHECK_MODULES(X11, [xproto >= 7.0.25]) dnl Allow checking code with lint, sparse, etc. XORG_WITH_LINT diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/mkfontscale-1.1.1/hash.c new/mkfontscale-1.1.2/hash.c --- old/mkfontscale-1.1.1/hash.c 2013-07-17 07:51:03.000000000 +0200 +++ new/mkfontscale-1.1.2/hash.c 2015-01-17 08:40:45.000000000 +0100 @@ -20,7 +20,9 @@ THE SOFTWARE. */ +#ifdef HAVE_CONFIG_H #include "config.h" +#endif #include <stdlib.h> #include <stdio.h> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/mkfontscale-1.1.1/list.c new/mkfontscale-1.1.2/list.c --- old/mkfontscale-1.1.1/list.c 2013-07-17 07:51:03.000000000 +0200 +++ new/mkfontscale-1.1.2/list.c 2015-01-17 08:40:45.000000000 +0100 @@ -235,7 +235,12 @@ int i; int l = listLength(old); ListPtr n; - ListPtr *sorted = malloc(l * sizeof(ListPtr)); + ListPtr *sorted; + + if (l <= 0) + return old; + + sorted = malloc(l * sizeof(ListPtr)); if (sorted == NULL) return old; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/mkfontscale-1.1.1/man/mkfontscale.man new/mkfontscale-1.1.2/man/mkfontscale.man --- old/mkfontscale-1.1.1/man/mkfontscale.man 2013-07-17 07:51:03.000000000 +0200 +++ new/mkfontscale-1.1.2/man/mkfontscale.man 2015-01-17 08:40:45.000000000 +0100 @@ -38,6 +38,8 @@ ] [ .B \-u | \-U ] [ +.B \-v +] [ .B \-\- ] [ .I directory @@ -132,6 +134,9 @@ disable (\fI-u\fP) or enable (\fI-U\fP) indexing of ISO 10646:1 font encodings (default: enabled). .TP +.B \-v +print program version and exit. +.TP .B \-\- end of options. .SH SEE ALSO diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/mkfontscale-1.1.1/missing new/mkfontscale-1.1.2/missing --- old/mkfontscale-1.1.1/missing 2013-07-17 07:51:11.000000000 +0200 +++ new/mkfontscale-1.1.2/missing 2015-01-17 08:40:50.000000000 +0100 @@ -1,9 +1,9 @@ #! /bin/sh # Common wrapper for a few potentially missing GNU programs. -scriptversion=2012-06-26.16; # UTC +scriptversion=2013-10-28.13; # UTC -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2014 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard <[email protected]>, 1996. # This program is free software; you can redistribute it and/or modify @@ -160,7 +160,7 @@ ;; autom4te*) echo "You might have modified some maintainer files that require" - echo "the 'automa4te' program to be rebuilt." + echo "the 'autom4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/mkfontscale-1.1.1/mkfontscale.c new/mkfontscale-1.1.2/mkfontscale.c --- old/mkfontscale-1.1.1/mkfontscale.c 2013-07-17 07:51:03.000000000 +0200 +++ new/mkfontscale-1.1.2/mkfontscale.c 2015-01-17 08:40:45.000000000 +0100 @@ -20,7 +20,9 @@ THE SOFTWARE. */ +#ifdef HAVE_CONFIG_H #include "config.h" +#endif #include <stdio.h> #include <stdlib.h> @@ -34,6 +36,7 @@ #include <ctype.h> #include <X11/Xos.h> +#include <X11/Xfuncproto.h> #include <X11/fonts/fontenc.h> #include <ft2build.h> #include FT_FREETYPE_H @@ -112,15 +115,24 @@ static int reencodeLegacy; static char *encodingPrefix; static char *exclusionSuffix; +static char *ProgramName; -static void +static void _X_NORETURN _X_COLD usage(void) { - fprintf(stderr, + fprintf(stderr, "Usage:\n" "mkfontscale [ -b ] [ -s ] [ -o filename ] [-x suffix ]\n" - " [ -a encoding ] [ -f fuzz ] [ -l ] " + " [ -a encoding ] [ -f fuzz ] [ -l ]\n" " [ -e directory ] [ -p prefix ] [ -n ] [ -r ] \n" - " [-u] [-U] [ directory ]...\n"); + " [-u] [-U] [-v] [ directory ]...\n"); + exit(1); +} + +static void _X_NORETURN _X_COLD +missing_arg (const char *option) +{ + fprintf(stderr, "%s: %s requires an argument\n", ProgramName, option); + usage(); } int @@ -131,6 +143,7 @@ int rc, ll = 0; char prefix[NPREFIX]; + ProgramName = argv[0]; encodingPrefix = NULL; exclusionSuffix = NULL; @@ -166,34 +179,31 @@ break; } else if (strcmp(argv[argn], "-x") == 0) { if(argn >= argc - 1) { - usage(); - exit(1); + missing_arg("-x"); } exclusionSuffix = argv[argn + 1]; argn += 2; } else if(strcmp(argv[argn], "-a") == 0) { if(argn >= argc - 1) { - usage(); - exit(1); + missing_arg("-a"); } makeList(&argv[argn + 1], 1, encodings, 0); argn += 2; } else if(strcmp(argv[argn], "-p") == 0) { if(argn >= argc - 1) { - usage(); - exit(1); + missing_arg("-p"); } if(strlen(argv[argn + 1]) > NPREFIX - 1) { + fprintf(stderr, "%s: argument to -p cannot be longer than " + "%d characters\n", ProgramName, NPREFIX - 1); usage(); - exit(1); } free(encodingPrefix); encodingPrefix = dsprintf("%s", argv[argn + 1]); argn += 2; } else if(strcmp(argv[argn], "-e") == 0) { if(argn >= argc - 1) { - usage(); - exit(1); + missing_arg("-e"); } rc = readEncodings(encodingsToDo, argv[argn + 1]); if(rc < 0) @@ -222,25 +232,21 @@ argn++; } else if(strcmp(argv[argn], "-o") == 0) { if(argn >= argc - 1) { - usage(); - exit(1); + missing_arg("-o"); } outfilename = argv[argn + 1]; argn += 2; } else if(strcmp(argv[argn], "-f") == 0) { if(argn >= argc - 1) { - usage(); - exit(1); + missing_arg("-f"); } bigEncodingFuzz = atof(argv[argn + 1]) / 100.0; argn += 2; - } else if (strcmp(argv[argn], "-r") == 0) { /* ignore for now */ - argn++; - } else if (strcmp(argv[argn], "-n") == 0) { - argn++; + } else if (strcmp(argv[argn], "-v") == 0) { + printf("%s\n", PACKAGE_STRING); + exit(0); } else { usage(); - exit(1); } } @@ -482,7 +488,7 @@ i++; } - if(safe_flag) return s; + if(safe_flag) return strdup(s); len = i; t = malloc(len + 1); @@ -506,7 +512,7 @@ { ListPtr xlfd = NULL; const char *foundry, *family, *weight, *slant, *sWidth, *adstyle, - *spacing, *full_name; + *spacing, *full_name, *tmp; TT_Header *head; TT_HoriHeader *hhea; TT_OS2 *os2; @@ -574,11 +580,11 @@ if(t1info) { if(!family) - family = t1info->family_name; + family = strdup(t1info->family_name); if(!family) - family = t1info->full_name; + family = strdup(t1info->full_name); if(!full_name) - full_name = t1info->full_name; + full_name = strdup(t1info->full_name); if(!foundry) foundry = notice_foundry(t1info->notice); if(!weight) @@ -595,7 +601,7 @@ if(!full_name) { fprintf(stderr, "Couldn't determine full name for %s\n", filename); - full_name = filename; + full_name = strdup(filename); } if(head) { @@ -620,11 +626,13 @@ notice = getName(face, TT_NAME_ID_TRADEMARK); if(notice) { foundry = notice_foundry(notice); + free(notice); } if(!foundry) { notice = getName(face, TT_NAME_ID_MANUFACTURER); if(notice) { foundry = notice_foundry(notice); + free(notice); } } } @@ -642,7 +650,7 @@ if(!foundry) foundry = "misc"; if(!family) { fprintf(stderr, "Couldn't get family name for %s\n", filename); - family = filename; + family = strdup(filename); } if(!weight) weight = "medium"; @@ -651,9 +659,11 @@ if(!adstyle) adstyle = ""; if(!spacing) spacing = "p"; - /* Yes, it's a memory leak. */ foundry = safe(foundry); + + tmp = family; family = safe(family); + free((void *)tmp); if(!isBitmap) { xlfd = listConsF(xlfd, @@ -676,6 +686,10 @@ spacing, 60); } } + + free((void *)family); + free((void *)foundry); + free((void *)full_name); return xlfd; } -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
