~tagglink/notes

a5936e2d770ba8c8cc85cb323b6ee9db0c87c19e — Tomas Granlund 1 year, 26 days ago 3c7e6fd master
append forward-slashes to paths
1 files changed, 5 insertions(+), 5 deletions(-)

M src/notes.c
M src/notes.c => src/notes.c +5 -5
@@ 126,7 126,7 @@ int write_note(const char *head, const char *foot, const char *dir,
  char tag_path[TAG_STR_SIZE];
  memset(out_path, 0, STR_SIZE);
  memset(tag_path, 0, TAG_STR_SIZE);
  sprintf(out_path, "%s%s", dir, note->path);
  sprintf(out_path, "%s/%s", dir, note->path);
  FILE *f = fopen(out_path, "w");
  if (!f) {
    fprintf(stderr, "could not open file '%s'.", out_path);


@@ 177,7 177,7 @@ int write_index_tag(const char *head, const char *foot, const char *dir,
                    bool public) {
  char out_path[STR_SIZE];
  memset(out_path, 0, STR_SIZE);
  sprintf(out_path, "%stags/%s.html", dir, tag);
  sprintf(out_path, "%s/tags/%s.html", dir, tag);
  strreplace(out_path, ' ', '-');
  FILE *f = fopen(out_path, "w");
  if (!f) {


@@ 232,7 232,7 @@ int write_indexes(const char *head, const char *foot, const char *dir,
  char tag_path[TAG_STR_SIZE];
  memset(out_path, 0, STR_SIZE);
  memset(tag_path, 0, TAG_STR_SIZE);
  sprintf(out_path, "%sindex.html", dir);
  sprintf(out_path, "%s/index.html", dir);
  FILE *f = fopen(out_path, "w");
  if (!f) {
    fprintf(stderr, "could not open file '%s'.\n", out_path);


@@ 387,7 387,7 @@ int main(int argc, const char **argv) {

    if (write_note(head_buffer, foot_buffer, lonely_directory, note_contents,
                   size, note)) {
      fprintf(stderr, "error writing note file '%s%s'.\n", lonely_directory,
      fprintf(stderr, "error writing note file '%s/%s'.\n", lonely_directory,
              note->path);
      exitcode = 3;
      goto exit;


@@ 399,7 399,7 @@ int main(int argc, const char **argv) {

      if (write_note(head_buffer, foot_buffer, public_directory, note_contents,
                     size, note)) {
        fprintf(stderr, "error writing public note file '%s%s'.\n",
        fprintf(stderr, "error writing public note file '%s/%s'.\n",
                public_directory, note->path);
        exitcode = 3;
        goto exit;