Skip to content

Commit

Permalink
GDALVersionInfo("--version"): tune output when GDAL_RELEASE_NICKNAME …
Browse files Browse the repository at this point in the history
…is empty
  • Loading branch information
rouault committed Mar 4, 2025
1 parent 38d330e commit 144e7d1
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions gcore/gdal_misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3005,9 +3005,13 @@ const char *CPL_STDCALL GDALVersionInfo(const char *pszRequest)
osVersionInfo.Printf("%s", GDAL_RELEASE_NICKNAME);
else // --version
{
osVersionInfo.Printf(
"GDAL %s \"%s\", released %d/%02d/%02d", GDAL_RELEASE_NAME,
GDAL_RELEASE_NICKNAME, GDAL_RELEASE_DATE / 10000,
osVersionInfo = "GDAL " GDAL_RELEASE_NAME;
if (GDAL_RELEASE_NICKNAME[0])
{
osVersionInfo += " \"" GDAL_RELEASE_NICKNAME "\"";
}
osVersionInfo += CPLString().Printf(
", released %d/%02d/%02d", GDAL_RELEASE_DATE / 10000,
(GDAL_RELEASE_DATE % 10000) / 100, GDAL_RELEASE_DATE % 100);
#if defined(__GNUC__) && !defined(__OPTIMIZE__)
// Cf https://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html
Expand Down

0 comments on commit 144e7d1

Please sign in to comment.