git://git.nikiroo.be
/
gofetch.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
411d339
)
:'(
author
Niki Roo
<niki@nikiroo.be>
Tue, 8 Aug 2017 17:36:48 +0000
(19:36 +0200)
committer
Niki Roo
<niki@nikiroo.be>
Tue, 8 Aug 2017 17:36:48 +0000
(19:36 +0200)
src/be/nikiroo/gofetch/Fetcher.java
patch
|
blob
|
blame
|
history
diff --git
a/src/be/nikiroo/gofetch/Fetcher.java
b/src/be/nikiroo/gofetch/Fetcher.java
index ea11894de37e7d6a19eb8a7f283e51ceb17089ae..15c56af748f5c9b4d5ff6adb1c4474de94f2e30e 100644
(file)
--- a/
src/be/nikiroo/gofetch/Fetcher.java
+++ b/
src/be/nikiroo/gofetch/Fetcher.java
@@
-85,7
+85,7
@@
public class Fetcher {
}
gopherBuilder.append(getLink(support.getDescription(),
}
gopherBuilder.append(getLink(support.getDescription(),
- support.getSelector(), false));
+ support.getSelector(),
true,
false));
String ref = support.getSelector();
while (ref.startsWith("/")) {
String ref = support.getSelector();
while (ref.startsWith("/")) {
@@
-93,7
+93,8
@@
public class Fetcher {
}
ref = "../" + ref + "/index.html";
}
ref = "../" + ref + "/index.html";
- htmlBuilder.append(getLink(support.getDescription(), ref, true));
+ htmlBuilder.append(getLink(support.getDescription(), ref, false,
+ true));
}
File gopherCache = new File(dir, preselector);
}
File gopherCache = new File(dir, preselector);
@@
-197,9
+198,9
@@
public class Fetcher {
if (enoughStories || last) {
if (!last) {
gopherLines.add(getLink("More", support.getSelector()
if (enoughStories || last) {
if (!last) {
gopherLines.add(getLink("More", support.getSelector()
- + ".cache_" + (page + 1), false));
+ + ".cache_" + (page + 1), false
, false
));
htmlLines.add(getLink("More", "index_" + (page + 1)
htmlLines.add(getLink("More", "index_" + (page + 1)
- + ".html", true));
+ + ".html",
false,
true));
}
write(gopherLines, varDir, ".cache", "", page);
}
write(gopherLines, varDir, ".cache", "", page);
@@
-226,10
+227,10
@@
public class Fetcher {
}
}
}
}
- private String getLink(String name, String ref, boolean html) {
+ private String getLink(String name, String ref, boolean
index, boolean
html) {
if (!html) {
if (!html) {
- return new StringBuilder().append(
"1" + name).append("\t"
)
- .append("1" + ref) //
+ return new StringBuilder().append(
(index ? "0" : "1") + name
)
+ .append("
\t").append("
1" + ref) //
.append("\t").append(hostname) //
.append("\t").append(Integer.toString(port)) //
.append("\r\n").toString();
.append("\t").append(hostname) //
.append("\t").append(Integer.toString(port)) //
.append("\r\n").toString();