commit - d9e16d252a4f84a6b30a7837ed6524e2dffec5ec
commit + b707cb51ed57c8d189a2e9f96ee31fa41a63e18c
blob - b1d098b4ce48e5f689c58ef3de8c4e8df1d6e19a
blob + f447b8dba23ed15edec2280a998efc7e4f7cf3d6
--- src/cmd/look.c
+++ src/cmd/look.c
int
locate(void)
{
- long top, bot, mid;
- long c;
+ vlong top, bot, mid;
+ int c;
int n;
bot = 0;
blob - 73e2b2d4f29b2898d911fbe51485773f9279219a
blob + db29986d732cf4a9e371f12fc3500108f53ba53a
--- src/cmd/tail.c
+++ src/cmd/tail.c
* the simple command tail -c, legal in v10, is illegal
*/
-long count;
+vlong count;
int anycount;
int follow;
int file = 0;
extern long tread(char*, long);
#define trunc tailtrunc
extern void trunc(Dir*, Dir**);
-extern long tseek(long, int);
+extern vlong tseek(vlong, int);
extern void twrite(char*, long);
extern void usage(void);
if(dir==REV && (units==CHARS || follow || origin==BEG))
fatal("incompatible options");
if(!anycount)
- count = dir==REV? ~0UL>>1: 10;
+ count = dir==REV? ~0ULL>>1: 10;
if(origin==BEG && units==LINES && count>0)
count--;
if(argc > 2)
trunc(Dir *old, Dir **new)
{
Dir *d;
- ulong olength;
+ vlong olength;
d = dirfstat(file);
if(d == nil)
long n = 0;
long bufsiz = 0;
char *buf = 0;
- long pos = tseek(0L, 2);
+ vlong pos = tseek(0L, 2);
for(first=1; pos>0 && count>0; first=0) {
n = pos>Bsize? Bsize: (int)pos;
twrite(buf, len);
}
-long
-tseek(long o, int p)
+vlong
+tseek(vlong o, int p)
{
o = seek(file, o, p);
if(o == -1)