home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gold Fish 1
/
GoldFishApril1994_CD1.img
/
d1xx
/
d136
/
paste
/
paste.diff
< prev
next >
Wrap
Text File
|
1988-03-19
|
3KB
|
165 lines
38c38
< * \b,\f, and \r. (Just because *I* can't imagine why you'd want
---
> * \b,\f,\r, and \v. (Just because *I* can't imagine why you'd want
47,50c47
< /* Modified to run under MINIX 1.1
< * by David O. Tinker (416) 978-3636 (utgpu!dtinker)
< * Sept. 19, 1987
< */
---
> #include <stdio.h>
52,54c49
< #include <stdio.h>
< #include "../include/errno.h" /* make sure errno.h is available */
< #include "../include/ctype.h" /* make sure ctype.h is available */
---
> extern int errno;
56c51
< extern int errno;
---
> #define CPM
58,60d52
< #define MINIX /* as opposed to C86, or AZTEC in my case */
< /* just in case I want to compile under DOS sometime */
<
72c64,65
< #define DEL '\177'
---
> #define VT '\v'
> #define DEL '\177'
77a71
> #define COMMAND "paste"
79,80c73
< char *cmdnam,
< toupper();
---
> char *cmdnam;
92a86,88
> #ifdef CPM
> cmdnam = COMMAND;
> #else
93a90
> #endif
95,96d91
< if(argc >= 2) {
<
105c100
< switch(toupper(argv[0][1]))
---
> switch(argv[0][1])
106a102
> case 'd':
116a113
> case 's':
127d123
< }
129,131d124
< else
< prerr(USAGE,"");
<
142,143d134
< _cleanup();
< exit(0);
318d308
< _cleanup();
365d354
< _cleanup();
391d379
< _cleanup();
409a398
> register char *strout;
411c400
< register char *strout;
---
> strout = strptr; /* Start at the same place, anyway */
413,414d401
< strout = strptr; /* Start at the same place, anyway */
<
422,423c409
<
< switch(toupper(*strptr))
---
> switch(*strptr)
428a415,416
> case 't':
> #ifdef CPM
429a418
> #endif
432a422,423
> case 'n':
> #ifdef CPM
433a425
> #endif
436a429,430
> case 'b':
> #ifdef CPM
437a432
> #endif
440a436,437
> case 'f':
> #ifdef CPM
441a439
> #endif
444a443,444
> case 'r':
> #ifdef CPM
445a446
> #endif
449,454c450,455
< default:
< *strout++ = *strptr;
< }
<
< strptr++;
< }
---
> case 'v':
> #ifdef CPM
> case 'V':
> #endif
> *strout++ = VT;
> break;
456,458c457,462
< }
< *strout = '\0'; /* Heaven forfend that we forget this! */
< }
---
> default:
> *strout++ = *strptr;
> }
>
> strptr++;
> }
459a464,467
> }
> *strout = '\0'; /* Heaven forfend that we forget this! */
> }
>
467c475
< fprintf(stderr,"%s : Usage: %s [-s] [-d<delimiter>] file1 file2 ...\n",cmdnam,cmdnam);
---
> fprintf(stderr,"%s : Usage: %s [-s] [-d<delimiterstring>] file1 file2 ...\n",cmdnam,cmdnam);
482d489
< _cleanup();
485,503d491
<
< char toupper(c) /* This is non-standard, but it works */
< char c;
< {
< char x;
<
< if (isalpha(c)) {
< if (c > 'Z') x = (c - ' ');
< else x = c;
< }
< else {
< if (isdigit(c))
< x = c;
< else x = '\0'; /* this will terminate a string
< * at any character other than a
< * letter or numeral. */
< }
< return (x);
< }