concat_error joins msg to the given error string, separating it from an existing error with a colon.
| 47 | // concat_error joins msg to the given error string, separating it from |
| 48 | // an existing error with a colon. |
| 49 | void |
| 50 | concat_error(std::string &error, const std::string &msg) |
| 51 | { |
| 52 | if (error.empty()) { |
| 53 | error.assign(msg); |
| 54 | } else { |
| 55 | error.append(": ").append(msg); |
| 56 | } |
| 57 | } |
| 58 | |
| 59 | } // namespace |
| 60 |