Baruch Even <[EMAIL PROTECTED]> writes: | +void SVN::scanMaster(void) | +{ | + cmd_ret const ret = RunSVNInfo(file_); | + string buffer = ret.second; | + string head; | + bool found = false; | + | + while (buffer.length() > 0) {
while (!buffer.empty()) { is better. | +void SVN::checkIn(string const & msg) | +{ | + doVCCommand("svn -q commit -m '" + shellEscape(msg) + "' " | + + QuoteName(OnlyFilename(owner_->fileName())), | + owner_->filePath()); We have that function? shellEscape.. I didn't know... | +class SVN : public VCS { | +public: | + explicit | + SVN(std::string const & f); | + | + /// return the revision file for the given file, if found | + static std::string const find_file(std::string const & file); | + | + virtual void registrer(std::string const & msg); | + | + virtual void checkIn(std::string const & msg); | + | + virtual void checkOut(void); | + | + virtual void revert(void); I don't think we use (void) elsewhere. | +2005-06-08 Baruch Even <[EMAIL PROTECTED]> | + | + * lstrings.h: | + * lstrings.C: Add shellEscape function to escape arguments for | + shell execution. Ahh you added it now. Did you f.ex. use php as guide? | +string const shellEscape(string const & str) | +{ | + string esc; | + for (string::size_type i = 0; i < str.length(); ++i) { | + unsigned char c = str[i]; | + switch (c) { | + case '\'': esc += "\\'"; break; | + case '\\': esc += "\\\\"; break; | + default: esc += c; break; | + } | + } Would be super good if this would work so that you didn't have to quote the argumetns at all. That would probably mean that ' ', '?', '!', ';' and some other needed to be escaped as well. (don't bother too much with this I am droodling.) I think the patch looks quite ok. The whole VCS machinery needs a workover though. -- Lgb