/* @(#)change_file_exten.c 2.1 93/05/18 */ /******************************************************************************/ /* function : change_file_exten.c */ /* */ /* subsystem : chgen */ /* */ /* input : s1 (file name to modify) , s2 (new extention) */ /* */ /* output : s1 (new file name) */ /* */ /* returns : void */ /* */ /* author : Steve Smith / Craig Smith */ /* */ /* created : July, 1991 */ /* */ /* revisions : */ /* */ /* description : This routine simply changes the file extention of the s1 */ /* filename to the extention specified by s2. First, the */ /* filename is scanned for either a dot (.) or end of string. */ /* The filename is then chopped at this point (adding the dot */ /* if needed) and then finally appending the s2 extention. */ /* */ /******************************************************************************/ #include #include #include "chgen_define.h" #include "chgen_externs.h" #include "prototypes.h" void change_file_exten (char *s1, char *s2) { int i ; for ( i = 0 ; ; i++ ) if (( s1[i+1] == '.' ) || ( s1[i+1] == '\0' )) { s1[i+1] = '.' ; s1[i+2] = '\0' ; break ; } strcat(s1,s2) ; return; }