From b77e0347c7cd60f141554462f21206ab77718bed Mon Sep 17 00:00:00 2001 From: Bill-Gray Date: Thu, 16 Nov 2023 17:54:26 -0500 Subject: [PATCH] Interactive Find_Orb's handling of observer location entries for ephems failed more than it ought to, sometimes without a warning message. It's now somewhat more robust. --- findorb.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/findorb.cpp b/findorb.cpp index e745d902..1d17e688 100644 --- a/findorb.cpp +++ b/findorb.cpp @@ -1294,14 +1294,20 @@ static void create_ephemeris( const double *orbit, const double epoch_jd, { if( strlen( buff) < 3) err_msg = "MPC codes must be at least three characters long"; - else if( strlen( buff) < 5 || !memcmp( buff, "Ast", 3)) + else if( strlen( buff) < 5 || !memcmp( buff, "Ast", 3) + || !get_lat_lon_info( NULL, buff)) strlcpy_error( mpc_code, buff); - else if( strlen( buff) > 4 && !get_observer_data( buff, buff, NULL)) + else if( strlen( buff) > 4) { - buff[4] = '\0'; - if( buff[3] == ' ') - buff[3] = '\0'; - strlcpy_error( mpc_code, buff); + if( !get_observer_data( buff, buff, NULL)) + { + buff[4] = '\0'; + if( buff[3] == ' ') + buff[3] = '\0'; + strlcpy_error( mpc_code, buff); + } + else + err_msg = "Didn't understand that observatory code"; } } break;