~ubuntu-branches/ubuntu/utopic/sblim-sfcc/utopic-proposed

« back to all changes in this revision

Viewing changes to backend/cimxml/objectpath.c

  • Committer: Package Import Robot
  • Author(s): Logan Rosen
  • Date: 2012-11-15 11:49:36 UTC
  • mfrom: (1.1.3)
  • Revision ID: package-import@ubuntu.com-20121115114936-53syr7flsjo21gw3
Tags: 2.2.4-0ubuntu1
* New upstream release.
* Add debian/watch file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
104
104
{
105
105
        struct native_cop * o = (struct native_cop *) cop;
106
106
 
107
 
        char * ns = ( nameSpace )? strdup ( nameSpace ): NULL;
 
107
        if ( o ) {
 
108
                char * ns = ( nameSpace )? strdup ( nameSpace ): NULL;
108
109
  
109
 
        if ( o ) {
110
110
                if ( o->nameSpace )
111
111
                     free ( o->nameSpace );
 
112
            o->nameSpace = ns;
112
113
        }
113
 
 
114
 
        o->nameSpace = ns;
115
114
        CMReturn ( CMPI_RC_OK );
116
115
}
117
116
 
144
143
{
145
144
        struct native_cop * o = (struct native_cop *) cop;
146
145
 
147
 
        char * cn = ( classname )? strdup ( classname ): NULL;
 
146
        if ( o ) {
 
147
                char * cn = ( classname )? strdup ( classname ): NULL;
148
148
  
149
 
        if ( o ) {
150
 
                free ( o->classname );
 
149
                if ( o->classname )
 
150
                    free ( o->classname );
 
151
            o->classname = cn;
151
152
        }
152
153
 
153
 
        o->classname = cn;
154
154
        CMReturn ( CMPI_RC_OK );
155
155
}
156
156
 
438
438
 
439
439
const char *getNameSpaceChars(CMPIObjectPath * cop)
440
440
{
 
441
   if (cop == NULL) return NULL;
 
442
 
441
443
        struct native_cop * o = (struct native_cop *) cop;
442
444
   return o->nameSpace;
443
445
}
451
453
   
452
454
   if (nss && nss->hdl) {
453
455
      ns=(char*)nss->hdl;
454
 
      if (ns) for (s=i=0, m=strlen(ns); i<m; i++,s++) {
 
456
      for (s=i=0, m=strlen(ns); i<m; i++,s++) {
455
457
         if (ns[i]=='/') {
456
458
            nsc[s]=0;
457
459
            ul->ft->append(ul,strdup(nsc));
463
465
   }   
464
466
   
465
467
   if (s) ul->ft->append(ul,strdup(nsc));
466
 
   CMRelease(nss);
 
468
   if (nss) CMRelease(nss);
467
469
   return ul;
468
470
}
469
471