$title
+
+ EOF
+ }
+ $i++;
+ }
+ print <
+ EOF
+
+ sub link {
+ local($_) = @_;
+ if (m@/test/read.cgi/@) {
+ return "$CGI?$_";
+ }
+ return $_;
+ }
+
+ sub subback {
+ $dat = $_;
+ s@http://@@ || exit;
+ $tmp = $ENV{"HOME"} . "/.w3m2ch/$_";
+ $dat =~ s/([^\w\/.\:\-])/\\$1/g;
+ $tmp =~ s/([^\w\/.\:\-])/\\$1/g;
+ ($dir = $tmp) =~ s@/[^/]+$@@;
+ $cmd = "mkdir -p $dir; $WGET -O $tmp $dat >/dev/null 2>&1";
+ system $cmd;
+ print <\n";
+ for (sort @files) {
+ s/\s+([A-Z]*) {1,8}\d+ (\w{3} ){2}[ \d]\d \d\d:\d\d:\d\d \d{4}\s*$// || next;
+ $c = $&;
+ s/^ //;
+ $_ eq "." && next;
+ print ""
+ . &html_quote($_) . ""
+ . &html_quote($c) . "\n";
+ }
+ print "\n";
+ }
+
+ sub get_file {
+ local($service, $file) = @_;
+ local($encoding, $type);
+ local($_, @cmd);
+
+ $_ = $file;
+ s@/@\\@g;
+ @cmd = ($SMBCLIENT, $service, @SMBCLIENT_OPT, "-E", "-c", "more \"$_\"");
+ $DEBUG && print "DEBUG: @cmd\n";
+
+ ($encoding, $type) = &guess_type($file);
+ $file =~ s@^.*/@@;
+ $| = 1;
+ print "Content-Encoding: $encoding\n" if $encoding;
+ print "Content-Type: $type; name=\"$file\"\n\n";
+
+ $ENV{"PAGER"} = $PAGER if $PAGER;
+ &exec_cmd(1, @cmd);
+ }
+
+ sub share_list {
+ local($server) = @_;
+ local(@share);
+ local($qserver, $_, $d, @c);
+
+ @share = &get_list(1, $server, "Share");
+
+ $qserver = &html_quote($server);
+ $server = &file_encode($server);
+
+ print "Content-Type: text/html\n\n";
+ print "\n";
+ print "
\n";
+ }
+
+ sub server_list {
+ local($group) = @_;
+ local($master, @server);
+ local($_, @c);
+
+ $master = &get_master($group);
+ @server = &get_list(0, $master, "Server");
+
+ $group = &html_quote($group);
+
+ print "Content-Type: text/html\n\n";
+ print "$qserver";
+ for (sort @share) {
+ ($_, $d, @c) = split(" ");
+ if ($d eq 'Disk') {
+ print " + "
+ . &html_quote($_) . "";
+ } else {
+ print " + "
+ . &html_quote($_);
+ }
+ print " "
+ . &html_quote($d) . " "
+ . &html_quote("@c") . "\n";
+ }
+ print " \n";
+ print "
\n";
+ }
+
+ sub group_list {
+ local($master, @group);
+ local($_, @c);
+
+ $master = &get_master($WORKGROUP || "-");
+ @group = &get_list(0, $master, "Workgroup");
+
+ print "Content-Type: text/html\n\n";
+ print "$group\n";
+ for (sort @server) {
+ ($_, @c) = split(" ");
+ print " + "
+ . &html_quote($_) . " "
+ . &html_quote("@c") . "\n";
+ }
+ print " \n";
+ for (sort @group) {
+ ($_, @c) = split(" ");
+ print "
\n";
+ }
+
+ sub check_opt_a {
+ local($_, $F, @cmd);
+
+ @cmd = ($SMBCLIENT, "-h");
+ $F = &open_pipe(0, @cmd);
+ while (<$F>) {
+ if (/^\s*-A\s/) {
+ $DEBUG && print "DEBUG: $_";
+ close($F);
+ return 1;
+ }
+ }
+ close($F);
+ return 0;
+ }
+
+ sub get_master {
+ local($group) = @_;
+ local($_, $F, @cmd);
+
+ @cmd = ($NMBLOOKUP, "-M", @NMBLOOKUP_OPT, $group);
+ $F = &open_pipe(0, @cmd);
+ $_ = <$F>;
+ $_ = <$F>;
+ close($F);
+ ($_) = split(/[,\s]/);
+ s/\.*$//;
+ return $_;
+ }
+
+ sub get_list {
+ local($passwd, $server, $header) = @_;
+ local(@list) = ();
+ local($_, @cmd, $F);
+
+ @cmd = ($SMBCLIENT, @SMBCLIENT_OPT, "-L", $server);
+ $F = &open_pipe($passwd, @cmd);
+ while (<$F>) {
+ if (/^\s*$header/) {
+ $DEBUG && print "DEBUG: $_";
+ last;
+ }
+ }
+ while (<$F>) {
+ /^\s*$/ && last;
+ $DEBUG && print "DEBUG: $_";
+ /^\S/ && last;
+ /^\s*-/ && next;
+ push(@list, $_);
+ }
+ close($F);
+ return @list;
+ }
+
+ sub open_pipe {
+ local($passwd, @cmd) = @_;
+ local($F) = $FILE++;
+
+ $DEBUG && print "DEBUG: @cmd\n";
+ open($F, "-|") || &exec_cmd($passwd, @cmd);
+ return $F;
+ }
+
+ sub exec_cmd {
+ local($passwd, @cmd) = @_;
+
+ $ENV{"LC_ALL"} = "C";
+ $ENV{"USER"} = $USER;
+ if ($passwd && !$USE_OPT_A) {
+ if ($USE_PASSWD_FILE) {
+ $ENV{"PASSWD_FILE"} = $PASSWD_FILE;
+ } elsif ($USE_PASSWD_FD) {
+ $ENV{"PASSWD_FD"} = $PASSWD_FD;
+ if (open(W, "|-")) {
+ print W $PASSWD;
+ close(W);
+ exit;
+ }
+ }
+ }
+ open(STDERR, ">/dev/null");
+ exec @cmd;
+ exit 1;
+ }
+
+ sub print_form {
+ local($_) = @_;
+ local($q) = &html_quote($_);
+ $_ = &file_encode($_);
+
+ print <"
+ . &html_quote($_) . " "
+ . &html_quote("@c") . "\n";
+ }
+ print "
+ * file.c (cur_title): added
+ (save_obuf): deleted
+ (process_title): added
+ (process_n_title): added
+ (feed_title): added
+ (HTMLtagproc1): rewrite HTML_TITLE, HTML_N_TITLE,
+ HTML_TITLE_ALT, HTML_N_HEAD, HTML_HEAD
+ (HTMLlineproc0): check RB_TITLE
+ (completeHTMLstream): add RB_TITLE
+ (loadHTMLstream): initialize cur_title
+
+ 2002-12-21 Hironori SAKAMOTO
+ * file.c (save_line): deleted
+ (save_prevchar): deleted
+ (save_obuf): added
+ (HTMLtagproc1): bcopy save_obuf
+
+ 2002-12-20 Hironori SAKAMOTO
+ * file.c (process_img): use div_int
+ (process_hr): use div_int
+ (process_idattr): don't close_anchor
+ (CLOSE_A): added
+ (HTMLtagproc1):
,- ,
- ,
- close anchor +
close anchor + close anchor +close anchor + close anchor + add DIV_INT + \n", f1); + else if (pre_mode & RB_INSELECT) + fputs("\n", f1); + else if (pre_mode & (RB_SCRIPT | RB_STYLE)) { + if (status != R_ST_NORMAL) + fputs(correct_irrtag(status)->ptr, f1); + if (pre_mode & RB_SCRIPT) + fputs("\n", f1); + else if (pre_mode & RB_STYLE) + fputs("\n", f1); + } + #ifdef USE_SCRIPT + else if (pre_mode & RB_NOSCRIPT) + fputs("\n", f1); + #endif while (t_stack--) fputs("\n", f1); UFclose(&f2); *************** *** 752,760 **** fputs("\n", f1); if (level == 0) { fputs("