diff options
author | Yves Combe <ycombe@src.gnome.org> | 2005-09-11 14:38:02 (GMT) |
---|---|---|
committer | Yves Combe <ycombe@src.gnome.org> | 2005-09-11 14:38:02 (GMT) |
commit | 3d82ed5ee71aa5b8cde8463ce5c12797bb343bf1 (patch) | |
tree | 6304ddec765124acf840c47bad120c1aa7294bf0 | |
parent | 150e3163b10ef2565d0df85d2cace168ab863a49 (diff) |
fix crash in reading, when looking for wordlevel_max file.
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | po/Makefile.in.in | 96 | ||||
-rw-r--r-- | src/boards/reading.c | 26 |
3 files changed, 72 insertions, 58 deletions
@@ -1,3 +1,11 @@ +2005-09-11 Yves Combe,,, <yves@ycombe.net> + + fix crash in reading, when looking for wordlevel_max file. + + * po/Makefile.in.in: + * src/boards/reading.c: (reading_next_level), + (reading_destroy_all_items), (get_wordfile): + 2005-09-10 Bruno coudoin <bruno.coudoin@free.fr> Added non functionnal hanoi_real game (the real tower of hanoi). diff --git a/po/Makefile.in.in b/po/Makefile.in.in index 435cd18..1a6961e 100644 --- a/po/Makefile.in.in +++ b/po/Makefile.in.in @@ -11,6 +11,11 @@ # # - Modified by jacob berkman <jacob@ximian.com> to install # Makefile.in.in and po2tbl.sed.in for use with glib-gettextize +# +# - Modified by Rodney Dawes <dobey@novell.com> for use with intltool +# +# We have the following line for use by intltoolize: +# INTLTOOL_MAKEFILE GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ PACKAGE = @PACKAGE@ @@ -21,27 +26,33 @@ SHELL = /bin/sh srcdir = @srcdir@ top_srcdir = @top_srcdir@ +top_builddir = .. VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ datadir = @datadir@ +datarootdir = @datarootdir@ libdir = @libdir@ localedir = $(libdir)/locale gnulocaledir = $(datadir)/locale gettextsrcdir = $(datadir)/glib-2.0/gettext/po subdir = po +install_sh = @install_sh@ +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ -MKINSTALLDIRS = $(top_srcdir)/@MKINSTALLDIRS@ CC = @CC@ GENCAT = @GENCAT@ GMSGFMT = @GMSGFMT@ MSGFMT = @MSGFMT@ XGETTEXT = @XGETTEXT@ -MSGMERGE = msgmerge +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +MSGMERGE = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --dist +GENPOT = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --pot DEFS = @DEFS@ CFLAGS = @CFLAGS@ @@ -54,8 +65,9 @@ COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) SOURCES = POFILES = @POFILES@ GMOFILES = @GMOFILES@ -DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(GETTEXT_PACKAGE).pot \ -$(POFILES) $(GMOFILES) $(SOURCES) +DISTFILES = ChangeLog Makefile.in.in POTFILES.in \ +$(POFILES) $(SOURCES) +EXTRA_DISTFILES = POTFILES.skip Makevars LINGUAS POTFILES = \ @@ -71,13 +83,13 @@ INSTOBJEXT = @INSTOBJEXT@ .po.pox: $(MAKE) $(GETTEXT_PACKAGE).pot - $(MSGMERGE) $< $(srcdir)/$(GETTEXT_PACKAGE).pot -o $*.pox + $(MSGMERGE) $< $(GETTEXT_PACKAGE).pot -o $*.pox .po.mo: $(MSGFMT) -o $@ $< .po.gmo: - file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \ + file=`echo $* | sed 's,.*/,,'`.gmo \ && rm -f $$file && $(GMSGFMT) -o $$file $< .po.cat: @@ -90,20 +102,15 @@ all: all-@USE_NLS@ all-yes: $(CATALOGS) all-no: -$(srcdir)/$(GETTEXT_PACKAGE).pot: $(POTFILES) - $(XGETTEXT) --default-domain=$(GETTEXT_PACKAGE) --directory=$(top_srcdir) \ - --add-comments --keyword=_ --keyword=N_ \ - --files-from=$(srcdir)/POTFILES.in \ - && test ! -f $(GETTEXT_PACKAGE).po \ - || ( rm -f $(srcdir)/$(GETTEXT_PACKAGE).pot \ - && mv $(GETTEXT_PACKAGE).po $(srcdir)/$(GETTEXT_PACKAGE).pot ) +$(GETTEXT_PACKAGE).pot: $(POTFILES) + $(GENPOT) install: install-exec install-data install-exec: install-data: install-data-@USE_NLS@ install-data-no: all install-data-yes: all - if test -r "$(MKINSTALLDIRS)"; then \ + if test -n "$(MKINSTALLDIRS)"; then \ $(MKINSTALLDIRS) $(DESTDIR)$(datadir); \ else \ $(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(datadir); \ @@ -117,7 +124,7 @@ install-data-yes: all esac; \ lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ dir=$(DESTDIR)$$destdir/$$lang/LC_MESSAGES; \ - if test -r "$(MKINSTALLDIRS)"; then \ + if test -n "$(MKINSTALLDIRS)"; then \ $(MKINSTALLDIRS) $$dir; \ else \ $(SHELL) $(top_srcdir)/mkinstalldirs $$dir; \ @@ -145,7 +152,7 @@ install-data-yes: all fi; \ done if test "$(PACKAGE)" = "glib"; then \ - if test -r "$(MKINSTALLDIRS)"; then \ + if test -n "$(MKINSTALLDIRS)"; then \ $(MKINSTALLDIRS) $(DESTDIR)$(gettextsrcdir); \ else \ $(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(gettextsrcdir); \ @@ -169,29 +176,37 @@ uninstall: rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \ rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \ done - rm -f $(DESTDIR)$(gettextsrcdir)/po-Makefile.in.in + if test "$(PACKAGE)" = "glib"; then \ + rm -f $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \ + fi -check: all +check: all $(GETTEXT_PACKAGE).pot dvi info tags TAGS ID: mostlyclean: - rm -f core core.* *.pox $(GETTEXT_PACKAGE).po *.old.po cat-id-tbl.tmp + rm -f core core.* *.pox $(GETTEXT_PACKAGE).pot *.old.po cat-id-tbl.tmp rm -fr *.o + rm -f .intltool-merge-cache clean: mostlyclean distclean: clean - rm -f Makefile Makefile.in POTFILES *.mo *.msg *.cat *.cat.m + rm -f Makefile Makefile.in POTFILES + rm -f *.mo *.msg *.cat *.cat.m $(GMOFILES) maintainer-clean: distclean @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." - rm -f $(GMOFILES) + rm -f Makefile.in.in distdir = ../$(GETTEXT_PACKAGE)-$(VERSION)/$(subdir) -dist distdir: update-po $(DISTFILES) +dist distdir: $(DISTFILES) dists="$(DISTFILES)"; \ + extra_dists="$(EXTRA_DISTFILES)"; \ + for file in $$extra_dists; do \ + test -f $$file && dists="$$dists $$file"; \ + done; \ for file in $$dists; do \ ln $(srcdir)/$$file $(distdir) 2> /dev/null \ || cp -p $(srcdir)/$$file $(distdir); \ @@ -199,19 +214,28 @@ dist distdir: update-po $(DISTFILES) update-po: Makefile $(MAKE) $(GETTEXT_PACKAGE).pot - cd $(srcdir); \ + tmpdir=`pwd`; \ catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ - mv $$lang.po $$lang.old.po; \ echo "$$lang:"; \ - if $(MSGMERGE) $$lang.old.po $(GETTEXT_PACKAGE).pot -o $$lang.po; then \ - rm -f $$lang.old.po; \ + result="`$(MSGMERGE) -o $$tmpdir/$$lang.new.po $$lang`"; \ + if $$result; then \ + if cmp $(srcdir)/$$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ + rm -f $$tmpdir/$$lang.new.po; \ + else \ + if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ + :; \ + else \ + echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ + rm -f $$tmpdir/$$lang.new.po; \ + exit 1; \ + fi; \ + fi; \ else \ echo "msgmerge for $$cat failed!"; \ - rm -f $$lang.po; \ - mv $$lang.old.po $$lang.po; \ + rm -f $$tmpdir/$$lang.new.po; \ fi; \ done @@ -219,17 +243,13 @@ update-po: Makefile # and Intltool tags (enclosed in square brackets), and appending a full # relative path to them POTFILES: POTFILES.in - ( if test 'x$(srcdir)' != 'x.'; then \ - posrcprefix='$(top_srcdir)/'; \ - else \ - posrcprefix="../"; \ - fi; \ + ( posrcprefix='$(top_srcdir)/'; \ rm -f $@-t $@ \ - && (sed -e '/^#/d' \ - -e "s/^\[.*\] +//" \ - -e '/^[ ]*$$/d' \ - -e "s@.*@ $$posrcprefix& \\\\@" < $(srcdir)/$@.in \ - | sed -e '$$s/\\$$//') > $@-t \ + && (sed -e '/^#/d' \ + -e 's/^[[].*] *//' \ + -e '/^[ ]*$$/d' \ + -e "s@^@ $$posrcprefix@" $(srcdir)/$@.in \ + | sed -e '$$!s/$$/ \\/') > $@-t \ && chmod a-w $@-t \ && mv $@-t $@ ) diff --git a/src/boards/reading.c b/src/boards/reading.c index d275e17..607c199 100644 --- a/src/boards/reading.c +++ b/src/boards/reading.c @@ -1,6 +1,6 @@ /* gcompris - reading.c * - * Time-stamp: <2005/09/01 22:38:40 yves> + * Time-stamp: <2005/09/11 16:21:05 yves> * * Copyright (C) 2000 Bruno Coudoin * @@ -269,9 +269,7 @@ static gint reading_next_level() gamewon = FALSE; - g_warning("destroying_all..."); reading_destroy_all_items(); - g_warning("destroying_all... done "); boardRootItem = GNOME_CANVAS_GROUP( gnome_canvas_item_new (gnome_canvas_root(gcomprisBoard->canvas), @@ -299,13 +297,9 @@ static gint reading_next_level() gcomprisBoard->number_of_sublevel=1; gcomprisBoard->sublevel=1; - g_warning("reading wordfile..."); read_wordfile(); - g_warning("reading wordfile...done"); display_what_to_do(boardRootItem); - g_warning("display_what_to_do...done"); ask_ready(TRUE); - g_warning("ask_ready...done"); return (FALSE); } @@ -323,12 +317,9 @@ static void reading_destroy_all_items() drop_items_id = 0; } - g_warning("destroying boardRootItem ..."); if(boardRootItem!=NULL) gtk_object_destroy (GTK_OBJECT(boardRootItem)); - g_warning("destroying boardRootItem ... done"); - boardRootItem = NULL; previousFocus.rootItem = NULL; toDeleteFocus.rootItem = NULL; @@ -339,18 +330,12 @@ static void reading_destroy_all_items() textToFind=NULL; } - g_warning("destroying words ..."); - if (words!=NULL) { g_ptr_array_free (words, TRUE); words=NULL; } - g_warning("destroying words ... done"); - - - } static GnomeCanvasItem *display_what_to_do(GnomeCanvasGroup *parent) @@ -750,12 +735,13 @@ static FILE *get_wordfile(const char *locale) if(wordsfd==NULL) { + g_free(filename); /* Second Try to find a file matching the 'max' and the locale */ - g_sprintf(filename, "%s%s%.2s", - PACKAGE_DATA_DIR, "/wordsgame/wordslevelmax.", - locale); + filename = g_strdup_printf("%s%s%.2s", + PACKAGE_DATA_DIR, "/wordsgame/wordslevelmax.", + locale); // g_message("Trying to open file %s ", filename); - + wordsfd = fopen (filename, "r"); } |