]> git.pld-linux.org Git - packages/links2.git/blob - links2-convert-old-bookmarks.patch
- updated for 2.1pre17
[packages/links2.git] / links2-convert-old-bookmarks.patch
1 --- links-2.0pre1/bookmarks.c.pix       2002-05-20 09:58:06.000000000 +0200
2 +++ links-2.0pre1/bookmarks.c   2002-05-22 14:29:30.000000000 +0200
3 @@ -643,6 +643,18 @@
4         if (!*bookmarks_file)
5                 snprintf(bookmarks_file,MAX_STR_LEN,"%sbookmarks.html",links_home);
6  
7 +       /* try to create bookmarks.html based on old bookmarks (from links <= 0.97) */
8 +       if (access(bookmarks_file, R_OK) != 0) {
9 +         char *prev;
10 +         if ((prev = get_current_dir_name()) && chdir(links_home) == 0) {
11 +           if (access("bookmarks", R_OK) == 0 && access("/usr/bin/perl", X_OK) == 0) {
12 +             system("/usr/bin/perl -lne '@l = split(q(\\|)); print qq(<dt><a href=\"$l[1]\">$l[0]</a>)' bookmarks > bookmarks.html");
13 +           }
14 +           chdir(prev);
15 +           free(prev);
16 +         }
17 +       }
18 +
19         bookmark_ld.codepage=get_cp_index("utf-8");
20         load_bookmarks();
21  }
This page took 0.087382 seconds and 3 git commands to generate.