~ubuntu-branches/ubuntu/natty/libxslt/natty-updates

« back to all changes in this revision

Viewing changes to python/libxslt.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2008-06-23 15:25:14 UTC
  • mfrom: (1.1.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20080623152514-nf37q9fm3drv69ps
Tags: 1.1.24-1ubuntu1
* merge from debian, remaining ubuntu changes:
  - build a python-libxslt1-dbg package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
  libxslt.c: this modules implements the main part of the glue of the
 
2
  libxslt.c: this module implements the main part of the glue of the
3
3
 *           libxslt library and the Python interpreter. It provides the
4
4
 *           entry points where an automatically generated stub is either
5
5
 *           unpractical or would not match cleanly the Python model.
666
666
    PyObject *pyobj_params;
667
667
    PyObject *pyobj_transformCtxt;
668
668
    const char **params = NULL;
669
 
    int len = 0, i = 0, j;
 
669
    int len = 0, i, j;
 
670
    ssize_t ppos = 0;
670
671
    PyObject *name;
671
672
    PyObject *value;
672
673
 
686
687
                    return(Py_None);
687
688
                }
688
689
                j = 0;
689
 
                while (PyDict_Next(pyobj_params, &i, &name, &value)) {
 
690
                while (PyDict_Next(pyobj_params, &ppos, &name, &value)) {
690
691
                    const char *tmp;
691
692
                    int size;
692
693
 
740
741
    PyObject *pyobj_doc;
741
742
    PyObject *pyobj_params;
742
743
    const char **params = NULL;
743
 
    int len = 0, i = 0, j;
 
744
    int len = 0, i, j, params_size;
 
745
    ssize_t ppos = 0;
744
746
    PyObject *name;
745
747
    PyObject *value;
746
748
 
752
754
        if (PyDict_Check(pyobj_params)) {
753
755
            len = PyDict_Size(pyobj_params);
754
756
            if (len > 0) {
755
 
                params = (const char **) xmlMalloc((len + 1) * 2 *
756
 
                                                   sizeof(char *));
 
757
                params_size = (len + 1) * 2 * sizeof(char *);
 
758
                params = (const char **) xmlMalloc(params_size);
757
759
                if (params == NULL) {
758
760
                    printf("libxslt_xsltApplyStylesheet: out of memory\n");
759
761
                    Py_INCREF(Py_None);
760
762
                    return(Py_None);
761
763
                }
 
764
                memset(params, 0, params_size);
762
765
                j = 0;
763
 
                while (PyDict_Next(pyobj_params, &i, &name, &value)) {
 
766
                while (PyDict_Next(pyobj_params, &ppos, &name, &value)) {
764
767
                    const char *tmp;
765
768
                    int size;
766
769
 
829
832
    if(!buffer || emitted < 0) 
830
833
      goto FAIL;
831
834
    /* We haven't tested the aberrant case of a transformation that
832
 
     * renders to an empty string. For now we try to play it save.
 
835
     * renders to an empty string. For now we try to play it safe.
833
836
     */
834
837
    if(size)
835
838
      {