If a user would add a trailing '/' or more e.g. '////' to the -datadir path, listwalletdir would strip one char of the wallename with every open.
This will happen if there is no wallets subdir e.g an older node or the wallets dir would have been renamed
This patch ̶s̶h̶o̶u̶l̶d̶ fix the issue reported in https://github.com/bitcoin/bitcoin/issues/19928
edit@saibato ̶S̶t̶i̶l̶l̶ ̶d̶r̶a̶f̶t̶:̶ ̶ ̶W̶i̶l̶l̶ ̶d̶o̶ ̶o̶n̶l̶y̶ ̶p̶a̶r̶t̶l̶y̶ ̶t̶h̶e̶ ̶j̶o̶b̶,̶ ̶h̶m̶m̶.̶.̶.̶
If a user would add a trailing '/' or more e.g. '////' to the -datadir path, listwalletdir would strip one char of the wallename with every open. This will happen if there is no wallets subdir e.g an older node or the wallets dir would have been renamed