configs.push_back("dhcpv4-over-dhcpv6.json");
configs.push_back("duid.json");
configs.push_back("hooks.json");
- // Removed because decommentJSON does not work with URLs
- // configs.push_back("iPXE.json");
+ configs.push_back("iPXE.json");
configs.push_back("leases-expiration.json");
configs.push_back("multiple-options.json");
configs.push_back("mysql-reservations.json");
}
// Second, let's get rid of the // comments
+ // at the beginning or after a control character.
size_t dblslash_pos = line.find("//");
- if (dblslash_pos != string::npos) {
+ if ((dblslash_pos != string::npos) &&
+ ((dblslash_pos == 0) ||
+ ((unsigned) line[dblslash_pos - 1] <= 32))) {
line = line.substr(0, dblslash_pos);
}
/// token locations should remain unaffected. This is rather naive
/// implementation, but it's probably sufficient for testing. It won't be able
/// to pick any trickier cases, like # or // appearing in strings, nested C++
-/// comments etc.
+/// comments etc at the exception of // in URLs.
///
/// @param input_file file to be stripped of comments
/// @return filename of a new file that has comments stripped from it