aboutsummaryrefslogtreecommitdiffstats
path: root/islang.c
diff options
context:
space:
mode:
authorFumitoshi UKAI <ukai@debian.or.jp>2001-11-24 02:01:26 +0000
committerFumitoshi UKAI <ukai@debian.or.jp>2001-11-24 02:01:26 +0000
commit975c8f9d43d4026bf1d669b08646e9d29a9d02e4 (patch)
treefd8aed139ffef712ccbb2d392c13b3949b0192c5 /islang.c
parent[w3m-dev 02530] segfault for bad cookie from local (diff)
downloadw3m-975c8f9d43d4026bf1d669b08646e9d29a9d02e4.tar.gz
w3m-975c8f9d43d4026bf1d669b08646e9d29a9d02e4.zip
run make indent
Diffstat (limited to '')
-rw-r--r--islang.c47
1 files changed, 25 insertions, 22 deletions
diff --git a/islang.c b/islang.c
index af124c7..bcf9688 100644
--- a/islang.c
+++ b/islang.c
@@ -2,7 +2,7 @@
* Copyright (c) 2000, NBG01720@nifty.ne.jp
*
* To compile this program:
- * gcc -Zomf -Zcrtdll -O2 -Wall -s islang.c
+ * gcc -Zomf -Zcrtdll -O2 -Wall -s islang.c
*/
#define INCL_DOSNLS
#include <os2.h>
@@ -11,27 +11,30 @@
#include <string.h>
#include <ctype.h>
-int main(int argc,char**argv){
- if(argc<=1)
- return 1;
-
- if(isdigit((int)*argv[1])){
- ULONG CpList[8],CpSize;
- APIRET rc=DosQueryCp(sizeof(CpList),CpList,&CpSize);
- if(rc)
- return rc;
- while(--argc>0)
- if(*CpList==atoi(argv[argc]))
- return 0;
- }else{
- char*lang=getenv("LANG");
- if(!lang||!*lang){
- lang=getenv("LANGUAGE");
- if(!lang||!*lang)
+int
+main(int argc, char **argv)
+{
+ if (argc <= 1)
return 1;
+
+ if (isdigit((int)*argv[1])) {
+ ULONG CpList[8], CpSize;
+ APIRET rc = DosQueryCp(sizeof(CpList), CpList, &CpSize);
+ if (rc)
+ return rc;
+ while (--argc > 0)
+ if (*CpList == atoi(argv[argc]))
+ return 0;
}
- if(!strnicmp(lang,argv[1],2))
- return 0;
- }
- return 1;
+ else {
+ char *lang = getenv("LANG");
+ if (!lang || !*lang) {
+ lang = getenv("LANGUAGE");
+ if (!lang || !*lang)
+ return 1;
+ }
+ if (!strnicmp(lang, argv[1], 2))
+ return 0;
+ }
+ return 1;
}