Ticket #315: opie-sync-fix_seperator_path.diff

File opie-sync-fix_seperator_path.diff, 1.2 KB (added by dgollub, 5 years ago)
  • src/opie_comms.c

     
    263263      env->username && 
    264264      env->password ) 
    265265  {   
    266       char* separator_path; 
     266      char* separator_path = NULL; 
     267      char* root_path = NULL; 
    267268      if ( env->use_qcop )  
    268269      { 
    269270          qcop_conn *qc_conn   = qcop_connect(env->url, env->username, env->password); 
    270           char* root_path      = qcop_get_root(qc_conn); 
     271          root_path = qcop_get_root(qc_conn); 
    271272          osync_trace( TRACE_INTERNAL, "QCop root path = %s", root_path ); 
    272           separator_path = g_strdup_printf("%s/", root_path); 
    273273 
    274 /*    if(!separator_path) 
    275      g_strdup("/");*/ 
     274          if ( root_path ) 
     275                separator_path = g_strdup_printf("%s/", root_path); 
     276 
    276277          qcop_disconnect(qc_conn); 
    277           if ( root_path ) g_free(root_path); 
    278       } else { 
    279           separator_path = g_strdup( "/" ); 
     278 
     279          if ( root_path )  
     280                g_free(root_path); 
    280281      } 
    281282 
     283      if ( !root_path ) 
     284          separator_path = g_strdup( "/" ); 
     285 
    282286    /* fetch each of the requested files */ 
    283287    for(t = 0; t < len; ++t) 
    284288    {