diff --git a/synaptic/common/rsources.cc b/synaptic/common/rsources.cc index 18d7ad9..5ba7787 100644 --- a/synaptic/common/rsources.cc +++ b/synaptic/common/rsources.cc @@ -326,12 +326,13 @@ bool SourcesList::UpdateSources() S += "[" + (*it)->VendorID + "] "; S += (*it)->URI + " "; - S += (*it)->Dist + " "; + S += (*it)->Dist; for (unsigned int J = 0; J < (*it)->NumSections; J++) - S += (*it)->Sections[J] + " "; + S += " " + (*it)->Sections[J]; } - ofs << S << endl; + if ( ! S.empty() ) // we needn't to write empty line ... + ofs << S << endl; } ofs.close(); } @@ -433,7 +434,11 @@ bool SourcesList::ReadVendors() { Configuration Cnf; - string CnfFile = _config->FindFile("Dir::Etc::vendorlist"); + string CnfFile = _config->FindDir("Dir::Etc::vendorparts"); + if (FileExists(CnfFile) == true) + if (ReadConfigDir(Cnf,CnfFile,true) == false) + return false; + CnfFile = _config->FindFile("Dir::Etc::vendorlist"); if (FileExists(CnfFile) == true) if (ReadConfigFile(Cnf, CnfFile, true) == false) return false; diff --git a/synaptic/gtk/rgrepositorywin.cc b/synaptic/gtk/rgrepositorywin.cc index 6ef14cc..59d604b 100644 --- a/synaptic/gtk/rgrepositorywin.cc +++ b/synaptic/gtk/rgrepositorywin.cc @@ -674,11 +674,15 @@ void RGRepositoryEditor::SelectionChanged(GtkTreeSelection *selection, gtk_entry_set_text(GTK_ENTRY(me->_entryURI), utf8(rec->URI.c_str())); gtk_entry_set_text(GTK_ENTRY(me->_entryDist), utf8(rec->Dist.c_str())); gtk_entry_set_text(GTK_ENTRY(me->_entrySect), ""); - - for (unsigned int I = 0; I < rec->NumSections; I++) { - gtk_entry_append_text(GTK_ENTRY(me->_entrySect), - utf8(rec->Sections[I].c_str())); - gtk_entry_append_text(GTK_ENTRY(me->_entrySect), " "); + + if (rec->NumSections > 0) { // if (... == 0) do nothing ... + for (unsigned int I = 0; I < (rec->NumSections - 1); I++) { + gtk_entry_append_text(GTK_ENTRY(me->_entrySect), + utf8(rec->Sections[I].c_str())); + gtk_entry_append_text(GTK_ENTRY(me->_entrySect), " "); + } + gtk_entry_append_text(GTK_ENTRY(me->_entrySect), + utf8(rec->Sections[rec->NumSections - 1].c_str())); } } else { //cout << "no selection" << endl;