--- /dev/null
+#include <stdlib.h>
+#include <stdio.h>
+
+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;
+}
+
#include <git2.h>
+#include "cp.h"
+
static git_repository *repo;
static const char *relpath = "";
"<title>", fp);
xmlencode(fp, description, strlen(description));
fprintf(fp, "</title>\n<link rel=\"icon\" type=\"image/png\" href=\"%sfavicon.png\" />\n", relpath);
- fprintf(fp, "<link rel=\"stylesheet\" type=\"text/css\" href=\"%sstyle.css\" />\n", relpath);
+ fprintf(fp, "<link rel=\"stylesheet\" type=\"text/css\" href=\"%sstyle.min.css\" />\n", relpath);
fputs("</head>\n<body>\n", fp);
fprintf(fp, "<table>\n<tr><td><img src=\"%slogo.png\" alt=\"\" width=\"32\" height=\"32\" /></td>\n"
"<td><span class=\"desc\">", relpath);
}
writefooter(stdout);
+ /* copy css */
+ char cwd[PATH_MAX];
+ strcpy(cwd, getcwd(cwd, sizeof(cwd)));
+ cp("/usr/local/share/stagit/style.min.css", strcat(cwd, "/style.min.css"));
+
/* cleanup */
git_repository_free(repo);
git_libgit2_shutdown();
#include <git2.h>
+#include "cp.h"
#include "compat.h"
struct deltainfo {
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)
{