Skip to content

Commit

Permalink
fix GPSBabel#982 ...
Browse files Browse the repository at this point in the history
garmin, ozi, xcsv mkshort options whitespace_ok, must_unique broken since 2006.
  • Loading branch information
tsteven4 committed Oct 16, 2024
1 parent 5dd9942 commit 563dc33
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 20 deletions.
12 changes: 6 additions & 6 deletions ozi.cc
Original file line number Diff line number Diff line change
Expand Up @@ -389,16 +389,16 @@ OziFormat::wr_init(const QString& fname)

mkshort_handle->set_length(xstrtoi(snlenopt, nullptr, 10));

if (snwhiteopt) {
mkshort_handle->set_whitespace_ok(xstrtoi(snwhiteopt, nullptr, 10));
if (snwhiteopt.has_value()) {
mkshort_handle->set_whitespace_ok(snwhiteopt);
}

if (snupperopt) {
mkshort_handle->set_mustupper(xstrtoi(snupperopt, nullptr, 10));
if (snupperopt.has_value()) {
mkshort_handle->set_mustupper(snupperopt);
}

if (snuniqueopt) {
mkshort_handle->set_mustuniq(xstrtoi(snuniqueopt, nullptr, 10));
if (snuniqueopt.has_value()) {
mkshort_handle->set_mustuniq(snuniqueopt);
}

mkshort_handle->set_badchars("\",");
Expand Down
8 changes: 4 additions & 4 deletions ozi.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,12 @@ class OziFormat : public Format
int new_track{};

OptionCString snlenopt;
OptionCString snwhiteopt;
OptionCString snupperopt;
OptionCString snuniqueopt;
OptionBool snwhiteopt;
OptionBool snupperopt;
OptionBool snuniqueopt;
OptionCString wptfgcolor;
OptionCString wptbgcolor;
OptionCString pack_opt;
OptionBool pack_opt;
int datum{};
OptionCString proximityarg;
double proximity{};
Expand Down
12 changes: 6 additions & 6 deletions xcsv.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1965,16 +1965,16 @@ XcsvFormat::wr_init(const QString& fname)
xcsv_file->mkshort_handle.set_length(xstrtoi(snlenopt, nullptr, 10));
}

if (snwhiteopt) {
xcsv_file->mkshort_handle.set_whitespace_ok(xstrtoi(snwhiteopt, nullptr, 10));
if (snwhiteopt.has_value()) {
xcsv_file->mkshort_handle.set_whitespace_ok(snwhiteopt);
}

if (snupperopt) {
xcsv_file->mkshort_handle.set_mustupper(xstrtoi(snupperopt, nullptr, 10));
if (snupperopt.has_value()) {
xcsv_file->mkshort_handle.set_mustupper(snupperopt);
}

if (snuniqueopt) {
xcsv_file->mkshort_handle.set_mustuniq(xstrtoi(snuniqueopt, nullptr, 10));
if (snuniqueopt.has_value()) {
xcsv_file->mkshort_handle.set_mustuniq(snuniqueopt);
}

xcsv_file->mkshort_handle.set_badchars(CSTR(xcsv_style->badchars));
Expand Down
8 changes: 4 additions & 4 deletions xcsv.h
Original file line number Diff line number Diff line change
Expand Up @@ -372,10 +372,10 @@ class XcsvFormat : public Format

OptionCString styleopt;
OptionCString snlenopt;
OptionCString snwhiteopt;
OptionCString snupperopt;
OptionCString snuniqueopt;
OptionCString prefer_shortnames;
OptionBool snwhiteopt;
OptionBool snupperopt;
OptionBool snuniqueopt;
OptionBool prefer_shortnames;
OptionCString xcsv_urlbase;
OptionCString opt_datum;
OptionCString opt_utc;
Expand Down

0 comments on commit 563dc33

Please sign in to comment.