Ticket #5791: mythtv-5791-allow_space_or_underscore_in_zone_id.patch

File mythtv-5791-allow_space_or_underscore_in_zone_id.patch, 1.1 KB (added by sphery <mtdean@…>, 12 years ago)
  • libs/libmyth/util.cpp

    old new  
    387387        have_zone_IDs = false;
    388388    }
    389389
    390     if (have_zone_IDs && (master_time_zone_ID != local_time_zone_ID))
     390    // Some distros use spaces rather than underscores in the zone ID, so
     391    // allow matches where the only difference is space vs. underscore.
     392    // Rather than modify the original zone ID's, modify a copy for the
     393    // comparison so the error message will show a difference in zone ID
     394    // as well as offset/current time in case the definitions differ.
     395    QString master_zone_compare = master_time_zone_ID;
     396    QString local_zone_compare = local_time_zone_ID;
     397    master_zone_compare.replace(' ', '_');
     398    local_zone_compare.replace(' ', '_');
     399    if (have_zone_IDs && (master_zone_compare != local_zone_compare))
    391400    {
    392401        VERBOSE(VB_IMPORTANT, "Time zone settings on the master backend "
    393402                              "differ from those on this system.");