119 |
fprintf(stderr, " -a: connection colour depth\n"); |
fprintf(stderr, " -a: connection colour depth\n"); |
120 |
fprintf(stderr, " -r: enable specified device redirection (this flag can be repeated)\n"); |
fprintf(stderr, " -r: enable specified device redirection (this flag can be repeated)\n"); |
121 |
fprintf(stderr, " '-r comport:COM1=/dev/ttyS0': enable serial redirection of /dev/ttyS0 to COM1\n"); |
fprintf(stderr, " '-r comport:COM1=/dev/ttyS0': enable serial redirection of /dev/ttyS0 to COM1\n"); |
122 |
fprintf(stderr, " or :COM1=/dev/ttyS0:9600,0|1|2,0|2,5|6|7|8:dtr \n"); |
fprintf(stderr, " or COM1=/dev/ttyS0,COM2=/dev/ttyS1\n"); |
123 |
fprintf(stderr, " '-r disk:A=/mnt/floppy': enable redirection of /mnt/floppy to A:\n"); |
fprintf(stderr, " '-r disk:A=/mnt/floppy': enable redirection of /mnt/floppy to A:\n"); |
124 |
fprintf(stderr, " or A=/mnt/floppy,D=/mnt/cdrom'\n"); |
fprintf(stderr, " or A=/mnt/floppy,D=/mnt/cdrom'\n"); |
125 |
fprintf(stderr, " '-r lptport:LPT1=/dev/lp0': enable parallel redirection of /dev/lp0 to LPT1\n"); |
fprintf(stderr, " '-r lptport:LPT1=/dev/lp0': enable parallel redirection of /dev/lp0 to LPT1\n"); |
126 |
fprintf(stderr, " or LPT1=/dev/lp0,LPT2=/dev/lp1\n"); |
fprintf(stderr, " or LPT1=/dev/lp0,LPT2=/dev/lp1\n"); |
127 |
fprintf(stderr, " '-r printer:mydeskjet': enable printer redirection\n"); |
fprintf(stderr, " '-r printer:mydeskjet': enable printer redirection\n"); |
128 |
fprintf(stderr, " or mydeskjet:\"HP Laserjet IIIP\" to enter server driver as well\n"); |
fprintf(stderr, " or mydeskjet:\"HP Laserjet IIIP\" to enter server driver as well\n"); |
129 |
fprintf(stderr, " '-r sound': enable sound redirection\n"); |
fprintf(stderr, " '-r sound': enable sound redirection\n"); |
750 |
{ |
{ |
751 |
char *nextval; |
char *nextval; |
752 |
char *p; |
char *p; |
753 |
|
char *mvp = 0; |
754 |
|
|
755 |
// EOS |
/* EOS */ |
756 |
if (*src == (char) 0x00) |
if (*src == (char) 0x00) |
757 |
return 0; |
return 0; |
758 |
|
|
759 |
p = src; |
p = src; |
760 |
// skip escaped needles. |
/* skip escaped needles */ |
761 |
while( (nextval = strchr(p, needle) ) ) |
while( (nextval = strchr(p, needle) ) ) |
762 |
{ |
{ |
763 |
if( *(nextval-1) != '\\' ) |
mvp = nextval - 1; |
764 |
|
/* found backslashed needle */ |
765 |
|
if( *mvp == '\\' && (mvp > src) ) |
766 |
|
{ |
767 |
|
/* move string one to the left */ |
768 |
|
while( *(mvp+1) != (char)0x00 ) |
769 |
|
{ |
770 |
|
*mvp = *(mvp+1); |
771 |
|
*mvp++; |
772 |
|
} |
773 |
|
*mvp = (char)0x00; |
774 |
|
p = nextval; |
775 |
|
} |
776 |
|
else |
777 |
|
{ |
778 |
|
p = nextval +1; |
779 |
break; |
break; |
780 |
p = nextval +1; |
} |
781 |
|
|
782 |
} |
} |
783 |
|
|
784 |
// more args available |
/* more args available */ |
785 |
if (nextval) |
if (nextval) |
786 |
{ |
{ |
787 |
*nextval = (char) 0x00; |
*nextval = (char) 0x00; |
788 |
return ++nextval; |
return ++nextval; |
789 |
} |
} |
790 |
|
|
791 |
// no more args after this, jump to EOS |
/* no more args after this, jump to EOS */ |
792 |
nextval = src + strlen(src); |
nextval = src + strlen(src); |
793 |
return nextval; |
return nextval; |
794 |
} |
} |