X-Git-Url: https://git.llucax.com/z.facultad/75.42/plaqui.git/blobdiff_plain/f53d095dd5ffb5afacf5c6f9a23d6cf1985fc237..eb95b779b5006ce4ef16ee1ffc1d15557d31ccef:/Server/src/command.cpp diff --git a/Server/src/command.cpp b/Server/src/command.cpp index f0e3ef1..5087d9e 100644 --- a/Server/src/command.cpp +++ b/Server/src/command.cpp @@ -54,7 +54,13 @@ Command::Command(const string& _target, const string& _command) { } void Command::build(void) { - uri = string("/") + target + '/' + command + String::join(args, "/"); + uri = string("/") + target; + if (command.length()) { + uri += '/' + command; + if (args.size()) { + uri += '/' + String::join(args, "/"); + } + } #ifdef DEBUG cerr << __FILE__ << ": build() = " << uri << endl; #endif // DEBUG @@ -93,6 +99,10 @@ void Command::add_arg(const std::string& arg) { } void Command::add_arg(const unsigned& arg) { +#ifdef DEBUG + cerr << __FILE__ << ": add_arg(arg = " << arg << ") = " + << String().from(arg) << endl; +#endif // DEBUG args.push_back(String().from(arg)); build(); }