/[monit]/monit/util.c
ViewVC logotype

Diff of /monit/util.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.139 by martinp, Thu Jan 6 20:51:49 2005 UTC revision 1.140 by hauk, Sun Jan 9 01:03:36 2005 UTC
# Line 123  static int is_url_unsafe(unsigned char * Line 123  static int is_url_unsafe(unsigned char *
123   */   */
124    
125    
 /* ------------------------------------------------------------- Definitions */  
   
   
 /** Defines supported url protocol structure */  
 typedef struct myurlprotocol {  
   int   id;  
   char *pattern;  
   char *protocol;  
   int   port;  
 } UrlProtocol_T;  
   
   
 /** Defines supported url protocol names and defaults */  
 UrlProtocol_T protocol[]=  {  
   {PROTOCOL_HTTP,  "http://",  "http",  PORT_HTTP  },  
   {PROTOCOL_HTTPS, "https://", "https", PORT_HTTPS },  
   {PROTOCOL_NULL,  NULL,       NULL,    0          }  
 };  
   
   
126  /* ------------------------------------------------------------------ Public */  /* ------------------------------------------------------------------ Public */
127    
128    
# Line 214  char *Util_ltrim(char *s) { Line 194  char *Util_ltrim(char *s) {
194    ASSERT(s);    ASSERT(s);
195    
196    while(*t==' ' || *t=='\t' || *t=='\r' || *t=='\n') t++;    while(*t==' ' || *t=='\t' || *t=='\r' || *t=='\n') t++;
197      if(t!=s) {
198    return strcpy(s, t);      memmove(s, t, t-s);
199        s[t-s]= 0;
200      }
201      
202      return s;
203    
204  }  }
205    
# Line 232  char *Util_rtrim(char *s) { Line 216  char *Util_rtrim(char *s) {
216    ASSERT(s);    ASSERT(s);
217    
218    while(*s) s++;    while(*s) s++;
219    while(*--s==' ' || *s=='\t' || *s=='\r' || *s=='\n') *s= '\0';    while(*--s==' ' || *s=='\t' || *s=='\r' || *s=='\n') *s= 0;
220        
221    return t;    return t;
222    

Legend:
Removed from v.1.139  
changed lines
  Added in v.1.140

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26