about summary refs log tree commit diff stats
path: root/WWW/Library/Implementation/HTFTP.c
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>2000-10-25 18:35:30 -0400
committerThomas E. Dickey <dickey@invisible-island.net>2000-10-25 18:35:30 -0400
commit5b28849589e7577a222685852b8601a1e7568726 (patch)
treecce74bbe5bf3c32f82c79a94c22eb29ca458c6ee /WWW/Library/Implementation/HTFTP.c
parentc16270eee5ad3c6a3b992a9684ff8bd60e60de96 (diff)
downloadlynx-snapshots-5b28849589e7577a222685852b8601a1e7568726.tar.gz
snapshot of project "lynx", label v2-8-4dev_12
Diffstat (limited to 'WWW/Library/Implementation/HTFTP.c')
-rw-r--r--WWW/Library/Implementation/HTFTP.c50
1 files changed, 25 insertions, 25 deletions
diff --git a/WWW/Library/Implementation/HTFTP.c b/WWW/Library/Implementation/HTFTP.c
index 82c8ccbf..49983c79 100644
--- a/WWW/Library/Implementation/HTFTP.c
+++ b/WWW/Library/Implementation/HTFTP.c
@@ -306,7 +306,7 @@ PRIVATE int next_data_char NOARGS
 	return FROMASCII(c);
     }
 #else
-    return (unsigned char)(*data_read_pointer++);
+    return UCH(*data_read_pointer++);
 #endif /* NOT_ASCII */
 }
 
@@ -1408,7 +1408,7 @@ PRIVATE BOOLEAN is_ls_date ARGS1(
 	char *,		s)
 {
     /* must start with three alpha characters */
-    if (!isalpha(*s++) || !isalpha(*s++) || !isalpha(*s++))
+    if (!isalpha(UCH(*s++)) || !isalpha(UCH(*s++)) || !isalpha(UCH(*s++)))
 	return FALSE;
 
     /* space or HT_NON_BREAK_SPACE */
@@ -1419,14 +1419,14 @@ PRIVATE BOOLEAN is_ls_date ARGS1(
     s++;
 
     /* space or digit */
-    if (!(*s == ' ' || isdigit(*s))) {
+    if (!(*s == ' ' || isdigit(UCH(*s)))) {
 	s++;
 	return FALSE;
     }
     s++;
 
     /* digit */
-    if (!isdigit(*s++))
+    if (!isdigit(UCH(*s++)))
 	return FALSE;
 
     /* space */
@@ -1434,29 +1434,29 @@ PRIVATE BOOLEAN is_ls_date ARGS1(
 	return FALSE;
 
     /* space or digit */
-    if (!(*s == ' ' || isdigit(*s))) {
+    if (!(*s == ' ' || isdigit(UCH(*s)))) {
 	s++;
 	return FALSE;
     }
     s++;
 
     /* digit */
-    if (!isdigit(*s++))
+    if (!isdigit(UCH(*s++)))
 	return FALSE;
 
     /* colon or digit */
-    if (!(*s == ':' || isdigit(*s))) {
+    if (!(*s == ':' || isdigit(UCH(*s)))) {
 	s++;
 	return FALSE;
     }
     s++;
 
     /* digit */
-    if (!isdigit(*s++))
+    if (!isdigit(UCH(*s++)))
 	return FALSE;
 
     /* space or digit */
-    if (!(*s == ' ' || isdigit(*s))) {
+    if (!(*s == ' ' || isdigit(UCH(*s)))) {
 	s++;
 	return FALSE;
     }
@@ -1539,7 +1539,7 @@ PRIVATE void parse_ls_line ARGS2(
     int    size_num=0;
 
     for (i = strlen(line) - 1;
-	 (i > 13) && (!isspace(line[i]) || !is_ls_date(&line[i-12])); i--)
+	 (i > 13) && (!isspace(UCH(line[i])) || !is_ls_date(&line[i-12])); i--)
 	; /* null body */
     line[i] = '\0';
     if (i > 13) {
@@ -1555,7 +1555,7 @@ PRIVATE void parse_ls_line ARGS2(
 	}
     }
     j = i - 14;
-    while (isdigit(line[j])) {
+    while (isdigit(UCH(line[j]))) {
 	size_num += (line[j] - '0') * base;
 	base *= 10;
 	j--;
@@ -1605,9 +1605,9 @@ PRIVATE void parse_dls_line ARGS3(
 	return;
     }
     if (len < 24 || line[23] != ' ' ||
-	(isspace(line[0]) && !*pspilledname)) {
+	(isspace(UCH(line[0])) && !*pspilledname)) {
 	/* this isn't the expected "dls" format! */
-	if (!isspace(line[0]))
+	if (!isspace(UCH(line[0])))
 	    *cps = '\0';
 	if (*pspilledname && !*line) {
 	    entry_info->filename = *pspilledname;
@@ -1631,7 +1631,7 @@ PRIVATE void parse_dls_line ARGS3(
     if (line[j] == '=' || line[j] == '-') {
 	StrAllocCopy(entry_info->type, ENTRY_IS_DIRECTORY);
     } else {
-	while (isdigit(line[j])) {
+	while (isdigit(UCH(line[j]))) {
 	    size_num += (line[j] - '0') * base;
 	    base *= 10;
 	    j--;
@@ -1742,8 +1742,8 @@ PRIVATE void parse_vms_dir_entry ARGS2(
 
     /** Track down the date. **/
     if ((cpd=strchr(cp, '-')) != NULL &&
-	strlen(cpd) > 9 && isdigit(*(cpd-1)) &&
-	isalpha(*(cpd+1)) && *(cpd+4) == '-') {
+	strlen(cpd) > 9 && isdigit(UCH(*(cpd-1))) &&
+	isalpha(UCH(*(cpd+1))) && *(cpd+4) == '-') {
 
 	/** Month **/
 	*(cpd+2) = (char) TOLOWER(*(cpd+2));
@@ -1751,7 +1751,7 @@ PRIVATE void parse_vms_dir_entry ARGS2(
 	sprintf(date, "%.3s ", cpd+1);
 
 	/** Day **/
-	if (isdigit(*(cpd-2)))
+	if (isdigit(UCH(*(cpd-2))))
 	    sprintf(date+4, "%.2s ", cpd-2);
 	else
 	    sprintf(date+4, "%c%.1s ", HT_NON_BREAK_SPACE, cpd-1);
@@ -1771,13 +1771,13 @@ PRIVATE void parse_vms_dir_entry ARGS2(
     if ((cpd=strchr(cp, '/')) != NULL) {
 	/* Appears be in used/allocated format */
 	cps = cpd;
-	while (isdigit(*(cps-1)))
+	while (isdigit(UCH(*(cps-1))))
 	    cps--;
 	if (cps < cpd)
 	    *cpd = '\0';
 	entry_info->size = atoi(cps);
 	cps = cpd+1;
-	while (isdigit(*cps))
+	while (isdigit(UCH(*cps)))
 	    cps++;
 	*cps = '\0';
 	ialloc = atoi(cpd+1);
@@ -1790,7 +1790,7 @@ PRIVATE void parse_vms_dir_entry ARGS2(
 	/* Now let's hunt for a lone, size number    */
 	while ((cps=strtok(NULL, sp)) != NULL) {
 	    cpd = cps;
-	    while (isdigit(*cpd))
+	    while (isdigit(UCH(*cpd)))
 		cpd++;
 	    if (*cpd == '\0') {
 		/* Assume it's blocks */
@@ -1839,7 +1839,7 @@ PRIVATE void parse_ms_windows_dir_entry ARGS2(
 	cps = LYSkipBlanks(cps);
 	cpd = LYSkipNonBlanks(cps);
 	*cpd++ = '\0';
-	if (isdigit(*cps)) {
+	if (isdigit(UCH(*cps))) {
 	    entry_info->size = atoi(cps);
 	} else {
 	    StrAllocCopy(entry_info->type, ENTRY_IS_DIRECTORY);
@@ -2057,7 +2057,7 @@ PRIVATE void parse_cms_dir_entry ARGS2(
 	cp = LYSkipBlanks(cp);
 	cps = LYSkipNonBlanks(cp);
 	*cps++ = '\0';
-	if (isdigit(*cp)) {
+	if (isdigit(UCH(*cp))) {
 	    RecordLength = atoi(cp);
 	}
     }
@@ -2068,7 +2068,7 @@ PRIVATE void parse_cms_dir_entry ARGS2(
 	cp = LYSkipBlanks(cp);
 	cps = LYSkipNonBlanks(cp);
 	*cps++ = '\0';
-	if (isdigit(*cp)) {
+	if (isdigit(UCH(*cp))) {
 	    Records = atoi(cp);
 	}
 	if (Records > 0 && RecordLength > 0) {
@@ -2087,7 +2087,7 @@ PRIVATE void parse_cms_dir_entry ARGS2(
     if (((cps < end) &&
 	 (cps = strchr(cpd, ':')) != NULL) &&
 	(cps < (end - 3) &&
-	 isdigit(*(cps+1)) && isdigit(*(cps+2)) && *(cps+3) == ':')) {
+	 isdigit(UCH(*(cps+1))) && isdigit(UCH(*(cps+2))) && *(cps+3) == ':')) {
 	cps += 3;
 	*cps = '\0';
 	if ((cps - cpd) >= 14) {
@@ -2269,7 +2269,7 @@ PRIVATE EntryInfo * parse_dir_entry ARGS3(
 		**  Strip off " -> pathname".
 		*/
 		for (i = len - 1; (i > 3) &&
-				  (!isspace(entry[i]) ||
+				  (!isspace(UCH(entry[i])) ||
 				   (entry[i-1] != '>')	||
 				   (entry[i-2] != '-') ||
 				   (entry[i-3] != ' ')); i--)
t: bold } /* Comment.Preproc */ .highlight .cpf { color: #888888 } /* Comment.PreprocFile */ .highlight .c1 { color: #888888 } /* Comment.Single */ .highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */ .highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ .highlight .ge { font-style: italic } /* Generic.Emph */ .highlight .ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */ .highlight .gr { color: #aa0000 } /* Generic.Error */ .highlight .gh { color: #333333 } /* Generic.Heading */ .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ .highlight .go { color: #888888 } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
#!/usr/bin/python -O
# ranger - a vim-inspired file manager for the console  (coding: utf-8)
# Copyright (C) 2009, 2010, 2011  Roman Zimbelmann <romanz@lavabit.com>
# This software is distributed under the terms of the GNU GPL version 3.

# =====================
# This embedded bash script can be executed by sourcing this file.
# It will cd to ranger's last location after you exit it.
# The first argument specifies the command to run ranger, the
# default is simply "ranger". (Not this file itself!)
# The other arguments are passed to ranger.
"""":
tempfile='/tmp/chosendir'
ranger="${1:-ranger}"
test -z "$1" || shift
"$ranger" --choosedir="$tempfile" "${@:-$(pwd)}"
returnvalue=$?
test -f "$tempfile" &&
if [ "$(cat -- "$tempfile")" != "$(echo -n `pwd`)" ]; then
	cd "$(cat "$tempfile")"
	rm -f -- "$tempfile"
fi
return $returnvalue
""" and None

import sys
from os.path import exists, abspath

# Need to find out whether or not the flag --clean was used ASAP,
# because --clean is supposed to disable bytecode compilation
argv = sys.argv[1:sys.argv.index('--')] if '--' in sys.argv else sys.argv[1:]
sys.dont_write_bytecode = '-c' in argv or '--clean' in argv

# Don't import ./ranger when running an installed binary at /usr/.../ranger
if __file__[:4] == '/usr' and exists('ranger') and abspath('.') in sys.path:
	sys.path.remove(abspath('.'))

# Start ranger
import ranger
sys.exit(ranger.main())