*
* Copyright (c) 1998
* Andrea Cocito (Nemesi).
+ * Copyright (c)
+ * Run (carlo@runaway.xs4all.nl) 1996
+ *
+ * mmatch/match/collapse
+ *
+ * Copyright (c)
+ * Run (carlo@runaway.xs4all.nl) 1996
*
* License follows:
*
register const char* u2 = s2;
while(ToLower(*u1) == ToLower(*u2)) {
- if(*u1++)
+ if(!*u1++)
return 0;
u2++;
return 0;
while(ToLower(*u1) == ToLower(*u2)) {
- if(*u1++ || !remaining--)
+ if(!*u1++ || !remaining--)
return 0;
u2++;
* Converts a long into a "p.q.r.s" IP address
*/
-const char *IPtostr(unsigned long IP) {
+const char *IPlongtostr(unsigned long IP) {
static char buf[16];
sprintf(buf,"%lu.%lu.%lu.%lu",(IP>>24),(IP>>16)&255,(IP>>8)&255,IP&255);
hours=(interval%(3600*24))/3600;
days=interval/(3600*24);
- if (days>0 || format==0) {
+ if (format==0 || (days>0 && (hours||minutes||seconds))) {
sprintf(outstring,"%d day%s, %02d:%02d:%02d",
days,(days==1)?"":"s",hours,minutes,seconds);
+ } else if (days>0) {
+ sprintf(outstring, "%d day%s",days,(days==1)?"":"s");
} else {
if (hours>0) {
pos += sprintf(outstring+pos,"%d hour%s ",hours,hours==1?"":"s");
return total;
}
-/* @GPL
+/*
* mmatch()
*
* Written by Run (carlo@runaway.xs4all.nl), 25-10-96
* a '?' in `new_mask' does not match a '\?' in `old_mask'.
* And ofcourse... a '*' in `new_mask' does not match a '\*' in `old_mask'...
* And last but not least, '\?' and '\*' in `new_mask' now become one character.
+ *
+ * Kindly BSD licensed by Run for Newserv.
*/
int mmatch(const char *old_mask, const char *new_mask)