This commit is contained in:
Richard Heck 2018-02-23 23:47:05 -05:00
parent a919d5b14a
commit 2f68fb5101

View File

@ -190,11 +190,11 @@ bool IndicesList::add(docstring const & n, docstring const & s)
docstring sc = s.empty() ? docstring sc = s.empty() ?
trim(lowercase(name.substr(0, 3))) : s; trim(lowercase(name.substr(0, 3))) : s;
if (findShortcut(sc) != 0) { if (findShortcut(sc) != 0) {
int i = 1; int k = 1;
docstring scn = sc + convert<docstring>(i); docstring scn = sc + convert<docstring>(k);
while (findShortcut(scn) != 0) { while (findShortcut(scn) != 0) {
++i; ++k;
scn = sc + convert<docstring>(i); scn = sc + convert<docstring>(k);
} }
in.setShortcut(scn); in.setShortcut(scn);
} else } else