aboutsummaryrefslogtreecommitdiff
path: root/mkfontscale/mkfontscale.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-03-25 10:41:05 +0000
committermarha <marha@users.sourceforge.net>2011-03-25 10:41:05 +0000
commit272e57235cd60a2e65ac8258d96a02eb3939b687 (patch)
tree789d74bd6ec1cc468f1f81aab97d4e4dfdb2d5c5 /mkfontscale/mkfontscale.c
parentb39f063f74bf0163eaf34db03134f226d18142ec (diff)
downloadvcxsrv-272e57235cd60a2e65ac8258d96a02eb3939b687.tar.gz
vcxsrv-272e57235cd60a2e65ac8258d96a02eb3939b687.tar.bz2
vcxsrv-272e57235cd60a2e65ac8258d96a02eb3939b687.zip
git update until 25 Mar 2011
xserver fontconfig glproto libXau libXft libXmu libfontenc libxcb mesa mkfontscale pixman randrproto xkeyboard-config xtrans xwininfo updated following packages: xproto-7.0.21 xineramaproto-1.2.1 libXt-1.1.1 libxkbfile-1.0.7 libXpm-3.5.9 libXfont-1.4.3 libXaw-1.0.9 bdftopcf-1.0.3 encodings-1.0.4 fixesproto-5.0 font-adobe-100dpi-1.0.3 font-adobe-75dpi-1.0.3 font-adobe-utopia-100dpi-1.0.4 font-adobe-utopia-75dpi-1.0.4 font-adobe-utopia-type1-1.0.4 font-alias-1.0.3 font-arabic-misc-1.0.3 font-bh-100dpi-1.0.3 font-bh-75dpi-1.0.3 font-bh-lucidatypewriter-100dpi-1.0.3 font-bh-lucidatypewriter-75dpi-1.0.3 font-bh-ttf-1.0.3 font-bh-type1-1.0.3 font-bitstream-100dpi-1.0.3 font-bitstream-75dpi-1.0.3 font-bitstream-speedo-1.0.2 font-bitstream-type1-1.0.3 font-cronyx-cyrillic-1.0.3 font-cursor-misc-1.0.3 font-daewoo-misc-1.0.3 font-dec-misc-1.0.3 font-ibm-type1-1.0.3 font-isas-misc-1.0.3 font-jis-misc-1.0.3 font-micro-misc-1.0.3 font-misc-cyrillic-1.0.3 font-misc-ethiopic-1.0.3 font-misc-meltho-1.0.3 font-misc-misc-1.1.2 font-mutt-misc-1.0.3 font-schumacher-misc-1.1.2 font-screen-cyrillic-1.0.4 font-sony-misc-1.0.3 font-sun-misc-1.0.3 font-util-1.2.0 font-winitzki-cyrillic-1.0.3 font-xfree86-type1-1.0.4
Diffstat (limited to 'mkfontscale/mkfontscale.c')
-rw-r--r--mkfontscale/mkfontscale.c25
1 files changed, 11 insertions, 14 deletions
diff --git a/mkfontscale/mkfontscale.c b/mkfontscale/mkfontscale.c
index 51dd47d49..ba2f84160 100644
--- a/mkfontscale/mkfontscale.c
+++ b/mkfontscale/mkfontscale.c
@@ -19,8 +19,6 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
-/* $XdotOrg: xc/programs/mkfontscale/mkfontscale.c,v 1.2 2004/04/23 19:54:36 eich Exp $ */
-/* $XFree86: xc/programs/mkfontscale/mkfontscale.c,v 1.21 2003/12/10 02:58:07 dawes Exp $ */
#include <stdio.h>
#include <stdlib.h>
@@ -48,12 +46,6 @@
#include "data.h"
#include "ident.h"
-#ifdef NEED_SNPRINTF
-#undef SCOPE
-#define SCOPE static
-#include "snprintf.c"
-#endif
-
#define NPREFIX 1024
#ifndef MAXFONTFILENAMELEN
@@ -63,6 +55,11 @@
#define MAXFONTNAMELEN 1024
#endif
+/* Two levels of macro calls are needed so that we stringify the value
+ of MAXFONT... and not the string "MAXFONT..." */
+#define QUOTE(x) #x
+#define STRINGIFY(x) QUOTE(x)
+
static char *encodings_array[] =
{ "ascii-0",
"iso8859-1", "iso8859-2", "iso8859-3", "iso8859-4", "iso8859-5",
@@ -682,11 +679,7 @@ readFontScale(HashTablePtr entries, char *dirname)
char *filename;
FILE *in;
int rc, count, i;
- char file[MAXFONTFILENAMELEN], font[MAXFONTNAMELEN];
- char format[100];
-
- snprintf(format, 100, "%%%ds %%%d[^\n]\n",
- MAXFONTFILENAMELEN, MAXFONTNAMELEN);
+ char file[MAXFONTFILENAMELEN+1], font[MAXFONTNAMELEN+1];
if(dirname[n - 1] == '/')
filename = dsprintf("%sfonts.scale", dirname);
@@ -711,7 +704,10 @@ readFontScale(HashTablePtr entries, char *dirname)
}
for(i = 0; i < count; i++) {
- rc = fscanf(in, format, file, font);
+ rc = fscanf(in,
+ "%" STRINGIFY(MAXFONTFILENAMELEN) "s "
+ "%" STRINGIFY(MAXFONTNAMELEN) "[^\n]\n",
+ file, font);
if(rc != 2)
break;
putHash(entries, font, file, 100);
@@ -982,6 +978,7 @@ doDirectory(char *dirname_given, int numEncodings, ListPtr encodingsToDo)
exit(1);
}
fprintf(encfile, "%d\n", numEncodings);
+ encodingsToDo = sortList(encodingsToDo);
for(lp = encodingsToDo; lp; lp = lp->next) {
fprintf(encfile, "%s\n", lp->value);
}