oga's tools
修订版 | 11997a65d58ba9e47bf7101edf34d6ef2c905446 (tree) |
---|---|
时间 | 2013-12-31 18:28:25 |
作者 | oga <oga@mxg....> |
Commiter | oga |
2013/12/31 lsc V0.05 fix no env(COLUMNS, LINES) prob.
@@ -5,6 +5,7 @@ | ||
5 | 5 | * 1995.08.21 V0.02 support 3050RX |
6 | 6 | * 1995.08.21 V0.03 support symbolic link. |
7 | 7 | * 2004.10.13 V0.04 support linux and fix link check |
8 | + * 2013.12.31 V0.05 fix no env prob | |
8 | 9 | * |
9 | 10 | */ |
10 | 11 |
@@ -30,7 +31,7 @@ | ||
30 | 31 | #define CALXY x*y_max+y+off_y*x_max*y_max |
31 | 32 | |
32 | 33 | int x_max = 0, y_max = 0, off_y = 0, max_file_len = 0; |
33 | -int env_x, env_y; | |
34 | +int env_x = 0, env_y = 0; /* V0.05-C */ | |
34 | 35 | |
35 | 36 | char dirf[MAX_ENT]; |
36 | 37 |
@@ -149,8 +150,12 @@ char *b[]; | ||
149 | 150 | } |
150 | 151 | */ |
151 | 152 | #else |
152 | - env_x = atoi(getenv("COLUMNS")); | |
153 | - env_y = atoi(getenv("LINES")); | |
153 | + if (getenv("COLUMNS")) { /* V0.05-A */ | |
154 | + env_x = atoi(getenv("COLUMNS")); | |
155 | + } | |
156 | + if (getenv("LINES")) { /* V0.05-A */ | |
157 | + env_y = atoi(getenv("LINES")); | |
158 | + } | |
154 | 159 | if (env_x == 0) |
155 | 160 | env_x = 80; |
156 | 161 | if (env_y == 0) |