mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-02 12:02:47 -05:00
Whitespace rationalisation of entire code base.
The number of people has been steadily increasing who read our source code with an editor that thinks tab stops are 4 spaces apart, as opposed to the traditional tty-derived 8 that the PuTTY code expects. So I've been wondering for ages about just fixing it, and switching to a spaces-only policy throughout the code. And I recently found out about 'git blame -w', which should make this change not too disruptive for the purposes of source-control archaeology; so perhaps now is the time. While I'm at it, I've also taken the opportunity to remove all the trailing spaces from source lines (on the basis that git dislikes them, and is the only thing that seems to have a strong opinion one way or the other). Apologies to anyone downstream of this code who has complicated patch sets to rebase past this change. I don't intend it to be needed again.
This commit is contained in:
@ -5,7 +5,7 @@
|
||||
* announcing what character set it will be using), and a set of
|
||||
* enumeration functions which return a list of supported
|
||||
* encodings one by one.
|
||||
*
|
||||
*
|
||||
* charset_from_localenc will attempt all other text translations
|
||||
* as well as this table, to maximise the number of different ways
|
||||
* you can select a supported charset.
|
||||
@ -83,10 +83,10 @@ const char *charset_to_localenc(int charset)
|
||||
int i;
|
||||
|
||||
for (i = 0; i < (int)lenof(localencs); i++)
|
||||
if (charset == localencs[i].charset)
|
||||
return localencs[i].name;
|
||||
if (charset == localencs[i].charset)
|
||||
return localencs[i].name;
|
||||
|
||||
return NULL; /* not found */
|
||||
return NULL; /* not found */
|
||||
}
|
||||
|
||||
int charset_from_localenc(const char *name)
|
||||
@ -94,24 +94,24 @@ int charset_from_localenc(const char *name)
|
||||
int i;
|
||||
|
||||
if ( (i = charset_from_mimeenc(name)) != CS_NONE)
|
||||
return i;
|
||||
return i;
|
||||
if ( (i = charset_from_xenc(name)) != CS_NONE)
|
||||
return i;
|
||||
return i;
|
||||
|
||||
for (i = 0; i < (int)lenof(localencs); i++) {
|
||||
const char *p, *q;
|
||||
p = name;
|
||||
q = localencs[i].name;
|
||||
while (*p || *q) {
|
||||
if (tolower((unsigned char)*p) != tolower((unsigned char)*q))
|
||||
break;
|
||||
p++; q++;
|
||||
}
|
||||
if (!*p && !*q)
|
||||
return localencs[i].charset;
|
||||
const char *p, *q;
|
||||
p = name;
|
||||
q = localencs[i].name;
|
||||
while (*p || *q) {
|
||||
if (tolower((unsigned char)*p) != tolower((unsigned char)*q))
|
||||
break;
|
||||
p++; q++;
|
||||
}
|
||||
if (!*p && !*q)
|
||||
return localencs[i].charset;
|
||||
}
|
||||
|
||||
return CS_NONE; /* not found */
|
||||
return CS_NONE; /* not found */
|
||||
}
|
||||
|
||||
int charset_localenc_nth(int n)
|
||||
@ -119,8 +119,8 @@ int charset_localenc_nth(int n)
|
||||
int i;
|
||||
|
||||
for (i = 0; i < (int)lenof(localencs); i++)
|
||||
if (localencs[i].return_in_enum && !n--)
|
||||
return localencs[i].charset;
|
||||
if (localencs[i].return_in_enum && !n--)
|
||||
return localencs[i].charset;
|
||||
|
||||
return CS_NONE; /* end of list */
|
||||
return CS_NONE; /* end of list */
|
||||
}
|
||||
|
Reference in New Issue
Block a user