]> git.armaanb.net Git - stagit.git/blobdiff - src/stagit.c
Copy css in stagit-index
[stagit.git] / src / stagit.c
index 264604eb4fffd984ff7ef47993e7ff0d4b44de84..aa99c7767eff014f68b0ec0477f6e1ac94b83a4c 100644 (file)
@@ -14,6 +14,7 @@
 
 #include <git2.h>
 
+#include "cp.h"
 #include "compat.h"
 
 struct deltainfo {
@@ -70,28 +71,6 @@ static char lastoidstr[GIT_OID_HEXSZ + 2]; /* id + newline + NUL byte */
 static FILE *rcachefp, *wcachefp;
 static const char *cachefile;
 
-int cp(char fileSource[], char fileDestination[])
-{
-    int c;
-    FILE *stream_R, *stream_W; 
-
-    stream_R = fopen(fileSource, "r");
-    if (stream_R == NULL)
-        return -1;
-    stream_W = fopen(fileDestination, "w");   //create and write to file
-    if (stream_W == NULL)
-     {
-        fclose(stream_R);
-        return -2;
-     }    
-    while ((c = fgetc(stream_R)) != EOF)
-        fputc(c, stream_W);
-    fclose(stream_R);
-    fclose(stream_W);
-
-    return 0;
-}
-
 void
 joinpath(char *buf, size_t bufsiz, const char *path, const char *path2)
 {