Branch: Tag:

2005-12-29

2005-12-29 23:52:54 by Martin Nilsson <mani@lysator.liu.se>

Less buggy implementation of get_language_from_name

Rev: src/post_modules/GTK2/source/gtksourcelanguagesmanager.pre:1.3

40:   //! Gets the GTK2.SourceLanguage which has this name.   {    pgtk_verify_inited(); -  if (args) { +  {    char *name;    const GSList *gsl;    int sel=0; -  name=PGTK_GETSTR(&Pike_sp[-args]); -  my_pop_n_elems(args); +  get_all_args("get_language_from_name", "%s", &name);    gsl=gtk_source_languages_manager_get_available_languages(    GTK_SOURCE_LANGUAGES_MANAGER(THIS->obj));    while (gsl) {    if (!strcmp(gtk_source_language_get_name(    GTK_SOURCE_LANGUAGE(gsl->data)),name)) { -  +  my_pop_n_elems(args);    push_gobject(gsl->data);    g_object_ref(gsl->data);    sel=1;
58:    }    gsl=g_slist_next(gsl);    } -  if (!sel) +  if (!sel) { +  my_pop_n_elems(args);    push_int(0); -  PGTK_FREESTR(name); -  } else { -  Pike_error("Expected 1 arg, got 0.\n"); +     }    } -  + }      array(string) get_lang_files_dirs()   //! Gets a list of language files directories.