diff --git a/documentation/new-notes/PR-678.md b/documentation/new-notes/PR-678.md index bd95b4c08..26b237186 100644 --- a/documentation/new-notes/PR-678.md +++ b/documentation/new-notes/PR-678.md @@ -9,5 +9,4 @@ now they switch to octal mode. For backward compatibility, this behavior can be switched off, returning to the old decimal only conversions, by setting the environment variable -`EPICS_DB_CONVERT_DECIMAL_ONLY` to anything except the empty string or -strings starting with `n`, `N`, `f`, `F` or `0` before `iocInit`. +`EPICS_DB_CONVERT_DECIMAL_ONLY` to `YES` (case insensitive) before `iocInit`. diff --git a/modules/database/src/ioc/misc/iocInit.c b/modules/database/src/ioc/misc/iocInit.c index fb39688cc..57f141014 100644 --- a/modules/database/src/ioc/misc/iocInit.c +++ b/modules/database/src/ioc/misc/iocInit.c @@ -31,6 +31,7 @@ #include "epicsPrint.h" #include "epicsSignal.h" #include "epicsThread.h" +#include "epicsString.h" #include "errMdef.h" #include "iocsh.h" #include "taskwd.h" @@ -132,10 +133,10 @@ static int iocBuild_1(void) } { - /* fall back to "old" decimal-only conversion if EPICS_DB_CONVERT_DECIMAL_ONLY - is set and does not look like meaning no/false/0 */ + /* fall back to "old" decimal-only conversion if + EPICS_DB_CONVERT_DECIMAL_ONLY is YES (case insensitive). */ const char* dec_only = getenv("EPICS_DB_CONVERT_DECIMAL_ONLY"); - if (dec_only && *dec_only && !strchr("nNfF0", *dec_only)) { + if (dec_only && epicsStrCaseCmp(dec_only, "YES") == 0) { dbConvertBase = 10; } } diff --git a/modules/libcom/src/misc/epicsConvert.h b/modules/libcom/src/misc/epicsConvert.h index 82e0dfcf0..6be4b5eb6 100644 --- a/modules/libcom/src/misc/epicsConvert.h +++ b/modules/libcom/src/misc/epicsConvert.h @@ -22,7 +22,7 @@ LIBCOM_API float epicsConvertDoubleToFloat(double value); /* dbConvertBase is used in dbPut and dbGet string to integer conversions. It defaults to 0 but is set to 10 if the EPICS_DB_CONVERT_DECIMAL_ONLY - environment variable is set. + environment variable is YES (case insensitive). */ LIBCOM_API extern int dbConvertBase;