home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frozen Fish 1: Amiga
/
FrozenFish-Apr94.iso
/
bbs
/
alib
/
d5xx
/
d510
/
atcopy.lha
/
ATCopy
/
Patch_option.c
< prev
next >
Wrap
C/C++ Source or Header
|
1991-06-29
|
2KB
|
76 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 .: 3
*
* Date Author Comment
* ========= ======== ====================
* 29-Apr-91 Peter Vorwerk Fixed for V2.22
* 05-Feb-91 Peter Vorwerk Fixed for V2.21
* 07-Jan-91 Peter Vorwerk Fixed for V2.2
* 30-Dec-90 Peter Vorwerk Created this file!
*
* $Revision Header ********************************************************/
#define REVISION 3
#include <stdio.h>
#include <string.h>
#include <libraries/arpbase.h>
#define OFFSET 0x65f
#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);
}