535 |
{ |
{ |
536 |
return "</div>"; |
return "</div>"; |
537 |
} |
} |
|
|
|
|
/* |
|
|
* Decide whether or not the path is binary file. |
|
|
* |
|
|
* i) path |
|
|
* r) 0: is not binary, 1: is binary |
|
|
*/ |
|
|
int |
|
|
is_binary(path) |
|
|
char *path; |
|
|
{ |
|
|
int ip; |
|
|
char buf[32]; |
|
|
int i, c, size; |
|
|
|
|
|
ip = open(path, 0); |
|
|
if (ip < 0) |
|
|
die("cannot open file '%s' in read mode.", path); |
|
|
size = read(ip, buf, sizeof(buf)); |
|
|
close(ip); |
|
|
if (size < 0) |
|
|
return 1; |
|
|
if (!strncmp(buf, "!<arch>", 7)) |
|
|
return 1; |
|
|
for (i = 0; i < size; i++) { |
|
|
c = (unsigned char)buf[i]; |
|
|
if (c == 0 || c > 127) |
|
|
return 1; |
|
|
} |
|
|
return 0; |
|
|
} |
|