Skip to content

Commit

Permalink
Paths in the error are put in single quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
veloman-yunkan authored and mgautierfr committed Mar 6, 2024
1 parent 0168764 commit 068555d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
10 changes: 5 additions & 5 deletions src/name_mapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ void HumanReadableNameMapper::mapName(const Library& library, std::string name,
} else {
const auto& currentBook = library.getBookById(bookId);
auto alreadyPresentPath = library.getBookById(m_nameToId[name]).getPath();
std::cerr << "Path collision: " << alreadyPresentPath
<< " and " << currentBook.getPath()
<< " can't share the same URL path '" << name << "'."
<< " Therefore, only " << alreadyPresentPath
<< " will be served." << std::endl;
std::cerr << "Path collision: '" << alreadyPresentPath
<< "' and '" << currentBook.getPath()
<< "' can't share the same URL path '" << name << "'."
<< " Therefore, only '" << alreadyPresentPath
<< "' will be served." << std::endl;
}
}

Expand Down
18 changes: 9 additions & 9 deletions test/name_mapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,19 +63,19 @@ class CapturedStderr


const std::string ZERO_FOUR_NAME_CONFLICT_MSG =
"Path collision: /data/zero_four_2021-10.zim and"
" /data/zero_four_2021-11.zim can't share the same URL path 'zero_four'."
" Therefore, only /data/zero_four_2021-10.zim will be served.\n";
"Path collision: '/data/zero_four_2021-10.zim' and"
" '/data/zero_four_2021-11.zim' can't share the same URL path 'zero_four'."
" Therefore, only '/data/zero_four_2021-10.zim' will be served.\n";

const std::string ZERO_SIX_NAME_CONFLICT_MSG =
"Path collision: /data/zërô + SIX.zim and "
"/data/zero_plus_six.zim can't share the same URL path 'zero_plus_six'."
" Therefore, only /data/zërô + SIX.zim will be served.\n";
"Path collision: '/data/zërô + SIX.zim' and "
"'/data/zero_plus_six.zim' can't share the same URL path 'zero_plus_six'."
" Therefore, only '/data/zërô + SIX.zim' will be served.\n";

const std::string ZERO_SEVEN_NAME_CONFLICT_MSG =
"Path collision: /data/subdir/zero_seven.zim and"
" /data/zero_seven.zim can't share the same URL path 'zero_seven'."
" Therefore, only /data/subdir/zero_seven.zim will be served.\n";
"Path collision: '/data/subdir/zero_seven.zim' and"
" '/data/zero_seven.zim' can't share the same URL path 'zero_seven'."
" Therefore, only '/data/subdir/zero_seven.zim' will be served.\n";

// Name conflicts in the default mode (without the --nodatealiases is off
const std::string DEFAULT_NAME_CONFLICTS = ZERO_SIX_NAME_CONFLICT_MSG
Expand Down

0 comments on commit 068555d

Please sign in to comment.