diff options
author | marcus <marcus@df743ca5-7f9a-e211-a948-0013205c9059> | 2005-08-17 02:47:05 +0800 |
---|---|---|
committer | marcus <marcus@df743ca5-7f9a-e211-a948-0013205c9059> | 2005-08-17 02:47:05 +0800 |
commit | da1b2366cec1ea098aa31f11e18e3b7370978e46 (patch) | |
tree | 41c9f6f15bbe4cd07e8ee1924001bdf90e77c351 | |
parent | 4e3c0e0bef5519a5e9a2b671112ac9bd3467be39 (diff) | |
download | marcuscom-ports-da1b2366cec1ea098aa31f11e18e3b7370978e46.tar marcuscom-ports-da1b2366cec1ea098aa31f11e18e3b7370978e46.tar.gz marcuscom-ports-da1b2366cec1ea098aa31f11e18e3b7370978e46.tar.bz2 marcuscom-ports-da1b2366cec1ea098aa31f11e18e3b7370978e46.tar.lz marcuscom-ports-da1b2366cec1ea098aa31f11e18e3b7370978e46.tar.xz marcuscom-ports-da1b2366cec1ea098aa31f11e18e3b7370978e46.tar.zst marcuscom-ports-da1b2366cec1ea098aa31f11e18e3b7370978e46.zip |
Instead of not hashing a NULL filename at all, create a [weak] random
number for the hash.
git-svn-id: svn://creme-brulee.marcuscom.com/ports/trunk@4515 df743ca5-7f9a-e211-a948-0013205c9059
-rw-r--r-- | graphics/cairo/Makefile | 4 | ||||
-rw-r--r-- | graphics/cairo/files/patch-src_cairo-ft-font.c | 38 |
2 files changed, 28 insertions, 14 deletions
diff --git a/graphics/cairo/Makefile b/graphics/cairo/Makefile index c0f47a242..572a8b6fd 100644 --- a/graphics/cairo/Makefile +++ b/graphics/cairo/Makefile @@ -3,12 +3,12 @@ # Whom: Michael Johnson <ahze@FreeBSD.org> # # $FreeBSD$ -# $MCom: ports/graphics/cairo/Makefile,v 1.21 2005/08/13 20:21:02 marcus Exp $ +# $MCom: ports/graphics/cairo/Makefile,v 1.22 2005/08/16 18:34:17 marcus Exp $ # PORTNAME= cairo PORTVERSION= 0.9.2 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= graphics MASTER_SITES= http://cairographics.org/snapshots/ diff --git a/graphics/cairo/files/patch-src_cairo-ft-font.c b/graphics/cairo/files/patch-src_cairo-ft-font.c index 86ce179c9..88bcadeed 100644 --- a/graphics/cairo/files/patch-src_cairo-ft-font.c +++ b/graphics/cairo/files/patch-src_cairo-ft-font.c @@ -1,13 +1,27 @@ ---- src/cairo-ft-font.c.orig Tue Aug 16 14:31:13 2005 -+++ src/cairo-ft-font.c Tue Aug 16 14:31:57 2005 -@@ -296,9 +296,8 @@ _cairo_ft_unscaled_font_init (cairo_ft_u - filename_copy = strdup (filename); - if (filename_copy == NULL) - return CAIRO_STATUS_NO_MEMORY; -+ _cairo_ft_unscaled_font_init_key (unscaled, filename_copy, id); - } -- -- _cairo_ft_unscaled_font_init_key (unscaled, filename_copy, id); +--- src/cairo-ft-font.c.orig Tue Aug 16 14:33:55 2005 ++++ src/cairo-ft-font.c Tue Aug 16 14:43:47 2005 +@@ -44,6 +44,10 @@ + #include <fontconfig/fontconfig.h> + #include <fontconfig/fcfreetype.h> - if (face) { - unscaled->from_face = 1; ++#include <sys/types.h> ++#include <time.h> ++#include <unistd.h> ++ + #include <ft2build.h> + #include FT_FREETYPE_H + #include FT_OUTLINE_H +@@ -257,7 +261,12 @@ _cairo_ft_unscaled_font_init_key (cairo_ + key->id = id; + + /* 1607 is just an arbitrary prime. */ +- hash = _cairo_hash_string (filename); ++ if (filename != NULL) { ++ hash = _cairo_hash_string (filename); ++ } else { ++ srandom(time(NULL) * getpid()); ++ hash = random(); ++ } + hash += ((unsigned long) id) * 1607; + + key->base.hash_entry.hash = hash; |