Ticket #243: const.patch
File const.patch, 2.3 KB (added by , 16 years ago) |
---|
-
lib/str_util.C
296 296 return argc; 297 297 } 298 298 299 static char x2c(c har *what) {299 static char x2c(const char *what) { 300 300 register char digit; 301 301 302 302 digit = (what[0] >= 'A' ? ((what[0] & 0xdf) - 'A')+10 : (what[0] - '0')); … … 391 391 url = buf; 392 392 } 393 393 394 void escape_url(c har *in, char*out) {394 void escape_url(const char *in, char*out) { 395 395 int x, y; 396 396 for (x=0, y=0; in[x]; ++x) { 397 397 if (isalnum(in[x])) { … … 442 442 // Escape a URL for the project directory, cutting off the "http://", 443 443 // converting everthing other than alphanumbers, ., - and _ to "_". 444 444 // 445 void escape_url_readable(c har *in, char* out) {445 void escape_url_readable(const char *in, char* out) { 446 446 int x, y; 447 c har *temp;447 const char *temp; 448 448 449 449 temp = strstr(in,"://"); 450 450 if (temp) { … … 502 502 503 503 // is the string a valid master URL, in canonical form? 504 504 // 505 bool valid_master_url(c har* buf) {506 c har*p, *q;505 bool valid_master_url(const char* buf) { 506 const char *p, *q; 507 507 size_t n; 508 508 bool bSSL = false; 509 509 … … 593 593 return buf; 594 594 } 595 595 596 void escape_project_url(c har *in, char* out) {596 void escape_project_url(const char *in, char* out) { 597 597 escape_url_readable(in, out); 598 598 char& last = out[strlen(out)-1]; 599 599 // remove trailing _ -
lib/str_util.h
52 52 extern void unescape_url(std::string& url); 53 53 extern void unescape_url(char *url); 54 54 extern void escape_url(std::string& url); 55 extern void escape_url(c har *in, char*out);56 extern void escape_url_readable(c har* in, char* out);57 extern void escape_project_url(c har *in, char* out);58 extern bool valid_master_url(c har*);55 extern void escape_url(const char *in, char*out); 56 extern void escape_url_readable(const char* in, char* out); 57 extern void escape_project_url(const char *in, char* out); 58 extern bool valid_master_url(const char*); 59 59 extern void canonicalize_master_url(char *url); 60 60 extern void canonicalize_master_url(std::string&); 61 61 #define safe_strcpy(x, y) strlcpy(x, y, sizeof(x))