]> code.delx.au - gnu-emacs/blobdiff - src/w32bdf.c
Merge from gnus--devo--0
[gnu-emacs] / src / w32bdf.c
index 358415c6e42a72bd3c6c2362f10f1c720d96202b..0d69240230766d7402fc60ed78f9ae1878b11b8b 100644 (file)
@@ -1,12 +1,12 @@
 /* Implementation of BDF font handling on the Microsoft W32 API.
    Copyright (C) 1999, 2001, 2002, 2003, 2004, 2005,
-                 2006, 2007  Free Software Foundation, Inc.
+                 2006, 2007, 2008  Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
 GNU Emacs is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
+the Free Software Foundation; either version 3, or (at your option)
 any later version.
 
 GNU Emacs is distributed in the hope that it will be useful,
@@ -93,7 +93,7 @@ proceed_file_line(char *key, char *start, int *len, char **val, char **next)
   return 1;
 }
 
-char*
+static char*
 get_quoted_string(char *start, char *end)
 {
   char *p, *q, *result;
@@ -261,7 +261,7 @@ w32_init_bdf_font(char *filename)
       error("Fail to open BDF file");
     }
   hfilemap = CreateFileMapping(hfile, NULL, PAGE_READONLY, 0, 0, NULL);
-  if (hfilemap == INVALID_HANDLE_VALUE)
+  if (!hfilemap)
     {
       CloseHandle(hfile);
       error("Can't map font");
@@ -302,7 +302,7 @@ w32_free_bdf_font(bdffont *fontp)
   font_char *pch;
   cache_bitmap *pcb;
 
-  UnmapViewOfFile(fontp->hfilemap);
+  UnmapViewOfFile(fontp->font);
   CloseHandle(fontp->hfilemap);
   CloseHandle(fontp->hfile);
 
@@ -828,7 +828,7 @@ int w32_BDF_to_x_font (char *file, char* xstr, int len)
   size = fileinfo.nFileSizeLow;
 
   hfilemap = CreateFileMapping (hfile, NULL, PAGE_READONLY, 0, 0, NULL);
-  if (hfilemap == INVALID_HANDLE_VALUE)
+  if (!hfilemap)
     {
       CloseHandle (hfile);
       return 0;
@@ -867,6 +867,7 @@ int w32_BDF_to_x_font (char *file, char* xstr, int len)
           retval = 1;
         }
     }
+  UnmapViewOfFile (font);
   CloseHandle (hfile);
   CloseHandle (hfilemap);
   return retval;