home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fish 'n' More 2
/
fishmore-publicdomainlibraryvol.ii1991xetec.iso
/
disks
/
disk458.lzh
/
ATCopy
/
Patch_Option.c
< prev
next >
Wrap
C/C++ Source or Header
|
1991-02-15
|
2KB
|
74 lines
/* $Revision Header *** Header built automatically - do not edit! ***********
*
* (C) Copyright 1990 by Peter Vorwerk
*
* Name .....: Patch_Option.c
* Created ..: Sunday 30-Dec-90 14:49
* Revision .: 1
*
* Date Author Comment
* ========= ======== ====================
* 07-Jan-91 Peter Vorwerk Fixed for V2.2
* 30-Dec-90 Peter Vorwerk Created this file!
*
* $Revision Header ********************************************************/
#define REVISION 1
#include <stdio.h>
#include <string.h>
#include <libraries/arpbase.h>
#define OFFSET 0x7ff
#define OFFSET2 OFFSET - 0x03
#define OFFSET3 OFFSET - 0x19
void main(int argc, char *argv[])
{
FILE *fp;
char *s;
char string[16];
if (argc < 3)
{
Printf("USAGE: %s ATCopy option [path]\n",argv[0]);
exit(10);
}
fp = fopen(argv[1],"r+");
if (fp == NULL)
{
Printf("Error: Can't open %s\n",argv[1]);
exit(10);
}
fseek(fp,OFFSET,0);
fscanf(fp,"%15s",string);
if (strcmp(string,"Option"))
{
Printf("Error: Wrong Version\nAbortet\n");
fclose(fp);
exit(10);
}
fseek(fp,OFFSET2,0);
s = argv[2];
do
{
fputc((int) *s++,fp);
}
while(*s != '\0');
fputc((int) *s++,fp);
if (argc > 3)
{
fseek(fp,OFFSET3,0);
s = argv[3];
do
{
fputc((int) *s++,fp);
}
while(*s != '\0');
fputc((int) *s++,fp);
}
fclose(fp);
exit(0);
}