home *** CD-ROM | disk | FTP | other *** search
- *** createdb.c.orig Wed Nov 4 22:04:20 1992
- --- createdb.c Wed Nov 4 23:56:23 1992
- ***************
- *** 126,131 ****
- --- 126,132 ----
- */
- if ((pid = fork()) < 0) {
- error("%s: cannot fork.\n", pname, 0, 0);
- + sleep(2);
- exit(1);
- }
-
- ***************
- *** 133,140 ****
- * Execute the editor.
- */
- if (pid == 0) {
- ! execl(editor, editor, fname, 0);
- perror(editor);
- exit(1);
- }
-
- --- 134,142 ----
- * Execute the editor.
- */
- if (pid == 0) {
- ! execlp(editor, editor, fname, 0);
- perror(editor);
- + sleep(2);
- exit(1);
- }
-
- *** dbio.c.orig Wed Nov 4 22:04:22 1992
- --- dbio.c Wed Nov 4 23:48:26 1992
- ***************
- *** 17,22 ****
- --- 17,23 ----
- *
- */
- #include <sys/param.h>
- + #include <sys/types.h>
- #include <sys/stat.h>
- #include <curses.h>
- #include <stdio.h>
- ***************
- *** 258,264 ****
- * Set the file mode to the mode of the original
- * file. Mark the database as unmodified.
- */
- ! fchmod(fileno(fp), st.st_mode & 0777);
- dbmodified = 0;
-
- fclose(fp);
- --- 259,265 ----
- * Set the file mode to the mode of the original
- * file. Mark the database as unmodified.
- */
- ! chmod(realfile, st.st_mode & 0777);
- dbmodified = 0;
-
- fclose(fp);
- *** defs.h.orig Wed Nov 4 22:04:22 1992
- --- defs.h Wed Nov 4 23:47:51 1992
- ***************
- *** 44,53 ****
- #endif
-
- /*
- ! * Usually defined in ttychars.h.
- */
- ! #ifndef CTRL
- ! #define CTRL(c) ('c' & 037)
- #endif
-
- /*
- --- 44,61 ----
- #endif
-
- /*
- ! * Usually defined in ttychars.h, but sometimes wrongly defined in others.
- */
- ! #undef CTRL
- ! #define CTRL(c) (c & 037)
- !
- ! #define bzero(s, n) memset(s, 0, n)
- !
- ! #include <limits.h>
- !
- ! #ifdef _POSIX_PATH_MAX
- ! #undef MAXPATHLEN
- ! #define MAXPATHLEN _POSIX_PATH_MAX
- #endif
-
- /*
- No differences encountered
- *** printdb.c.orig Wed Nov 4 22:04:25 1992
- --- printdb.c Tue Nov 10 23:16:13 1992
- ***************
- *** 16,22 ****
- * Initial revision
- *
- */
- ! #include <sys/file.h>
- #include <stdio.h>
- #include "defs.h"
-
- --- 16,22 ----
- * Initial revision
- *
- */
- ! #include <unistd.h>
- #include <stdio.h>
- #include "defs.h"
-
- *** screen.c.orig Wed Nov 4 22:05:31 1992
- --- screen.c Tue Nov 10 23:10:34 1992
- ***************
- *** 66,79 ****
- */
- while ((c = getchar()) != EOF) {
- switch (c) {
- ! case CTRL(a): /* beginning of line */
- col = col0;
- break;
- ! case CTRL(b): /* back character */
- if (col > col0)
- col--;
- break;
- ! case CTRL(d): /* delete character */
- /*
- * If there's stuff in the string,
- * delete this character.
- --- 66,79 ----
- */
- while ((c = getchar()) != EOF) {
- switch (c) {
- ! case CTRL('a'): /* beginning of line */
- col = col0;
- break;
- ! case CTRL('b'): /* back character */
- if (col > col0)
- col--;
- break;
- ! case CTRL('d'): /* delete character */
- /*
- * If there's stuff in the string,
- * delete this character.
- ***************
- *** 102,115 ****
- }
-
- break;
- ! case CTRL(e): /* end of line */
- col = col0 + len;
- break;
- ! case CTRL(f): /* forward character */
- if ((col - col0) < len)
- col++;
- break;
- ! case CTRL(h): /* backspace delete */
- case '\177':
- /*
- * If there's stuff in the string,
- --- 102,115 ----
- }
-
- break;
- ! case CTRL('e'): /* end of line */
- col = col0 + len;
- break;
- ! case CTRL('f'): /* forward character */
- if ((col - col0) < len)
- col++;
- break;
- ! case CTRL('h'): /* backspace delete */
- case '\177':
- /*
- * If there's stuff in the string,
- ***************
- *** 139,145 ****
- delch();
- }
- break;
- ! case CTRL(k): /* kill line */
- /*
- * Clear the string.
- */
- --- 139,145 ----
- delch();
- }
- break;
- ! case CTRL('k'): /* kill line */
- /*
- * Clear the string.
- */
- ***************
- *** 152,164 ****
- clrtoeol();
- }
- break;
- ! case CTRL(l): /* redraw screen */
- wrefresh(curscr);
- break;
- case '\n': /* return the string */
- line[len] = '\0';
- return;
- default: /* regular character */
- /*
- * If it's the user's line-kill character,
- * we'll accept that to kill the line too.
- --- 152,166 ----
- clrtoeol();
- }
- break;
- ! case CTRL('l'): /* redraw screen */
- wrefresh(curscr);
- break;
- + case '\r': /* return the string */
- case '\n': /* return the string */
- line[len] = '\0';
- return;
- default: /* regular character */
- + #if 0
- /*
- * If it's the user's line-kill character,
- * we'll accept that to kill the line too.
- ***************
- *** 171,177 ****
- *line = '\0';
- len = 0;
- }
- ! else {
- /*
- * If it's a printable character,
- * insert it into the string.
- --- 173,181 ----
- *line = '\0';
- len = 0;
- }
- ! else
- ! #endif
- ! {
- /*
- * If it's a printable character,
- * insert it into the string.
- ***************
- *** 332,338 ****
- case 'x':
- byebye();
- break;
- ! case CTRL(l): /* redraw screen */
- wrefresh(curscr);
- break;
- }
- --- 336,342 ----
- case 'x':
- byebye();
- break;
- ! case CTRL('l'): /* redraw screen */
- wrefresh(curscr);
- break;
- }
- ***************
- *** 414,419 ****
- --- 418,424 ----
- * Dispatch the command...
- */
- switch (c) {
- + case '\r': /* go to next entry */
- case '\n': /* go to next entry */
- /*
- * Save this one.
- ***************
- *** 567,580 ****
- len = &tmp.db_lens[row];
-
- switch (c) {
- ! case CTRL(a): /* beginning of line */
- col = col0;
- break;
- ! case CTRL(b): /* back character */
- if (col > col0)
- col--;
- break;
- ! case CTRL(d): /* delete character */
- if (*len) {
- /*
- * Calculate position of character
- --- 572,585 ----
- len = &tmp.db_lens[row];
-
- switch (c) {
- ! case CTRL('a'): /* beginning of line */
- col = col0;
- break;
- ! case CTRL('b'): /* back character */
- if (col > col0)
- col--;
- break;
- ! case CTRL('d'): /* delete character */
- if (*len) {
- /*
- * Calculate position of character
- ***************
- *** 599,612 ****
- }
-
- break;
- ! case CTRL(e): /* end of line */
- col = col0 + *len;
- break;
- ! case CTRL(f): /* forward character */
- if ((col - col0) < *len)
- col++;
- break;
- ! case CTRL(h): /* backspace delete */
- case '\177':
- if (*len) {
- /*
- --- 604,617 ----
- }
-
- break;
- ! case CTRL('e'): /* end of line */
- col = col0 + *len;
- break;
- ! case CTRL('f'): /* forward character */
- if ((col - col0) < *len)
- col++;
- break;
- ! case CTRL('h'): /* backspace delete */
- case '\177':
- if (*len) {
- /*
- ***************
- *** 632,638 ****
- delch();
- }
- break;
- ! case CTRL(k): /* kill line */
- /*
- * Kill the line.
- */
- --- 637,643 ----
- delch();
- }
- break;
- ! case CTRL('k'): /* kill line */
- /*
- * Kill the line.
- */
- ***************
- *** 645,654 ****
- clrtoeol();
- }
- break;
- ! case CTRL(l): /* redraw screen */
- wrefresh(curscr);
- break;
- ! case CTRL(n): /* next line */
- /*
- * Wrap around to the top if necessary.
- */
- --- 650,659 ----
- clrtoeol();
- }
- break;
- ! case CTRL('l'): /* redraw screen */
- wrefresh(curscr);
- break;
- ! case CTRL('n'): /* next line */
- /*
- * Wrap around to the top if necessary.
- */
- ***************
- *** 662,668 ****
- if ((col - col0) > tmp.db_lens[row])
- col = col0 + tmp.db_lens[row];
- break;
- ! case CTRL(p): /* previous line */
- /*
- * Wrap around if necessary.
- */
- --- 667,673 ----
- if ((col - col0) > tmp.db_lens[row])
- col = col0 + tmp.db_lens[row];
- break;
- ! case CTRL('p'): /* previous line */
- /*
- * Wrap around if necessary.
- */
- ***************
- *** 676,682 ****
- if ((col - col0) > tmp.db_lens[row])
- col = col0 + tmp.db_lens[row];
- break;
- ! case CTRL([): /* save entry */
- /*
- * Prompt for whether to save the entry.
- */
- --- 681,687 ----
- if ((col - col0) > tmp.db_lens[row])
- col = col0 + tmp.db_lens[row];
- break;
- ! case CTRL('['): /* save entry */
- /*
- * Prompt for whether to save the entry.
- */
- ***************
- *** 687,692 ****
- --- 692,698 ----
- * See what they said.
- */
- switch (c) {
- + case '\r': /* never mind */
- case '\n': /* never mind */
- move(idx.idx_nlines+2, 0);
- clrtoeol();
- ***************
- *** 717,722 ****
- --- 723,729 ----
- return(0);
- }
- break;
- + case '\r': /* go to next line */
- case '\n': /* go to next line */
- /*
- * Wrap around if necessary.
- ***************
- *** 726,731 ****
- --- 733,739 ----
- col = col0;
- break;
- default: /* something else */
- + #if 0
- /*
- * If it's the user's kill character, we'll
- * accept that to delete the line too.
- ***************
- *** 738,744 ****
- *line = '\0';
- *len = 0;
- }
- ! else {
- /*
- * If it's a printable character, insert
- * it into the string.
- --- 746,754 ----
- *line = '\0';
- *len = 0;
- }
- ! else
- ! #endif
- ! {
- /*
- * If it's a printable character, insert
- * it into the string.
- *** searchdb.c.orig Wed Nov 4 22:04:33 1992
- --- searchdb.c Wed Nov 4 23:08:32 1992
- ***************
- *** 38,44 ****
- * to all lower case.
- */
- if (igncase) {
- ! for (p = pattern; *p != NULL; p++) {
- if (isupper(*p))
- *p = tolower(*p);
- }
- --- 38,44 ----
- * to all lower case.
- */
- if (igncase) {
- ! for (p = pattern; *p != 0; p++) {
- if (isupper(*p))
- *p = tolower(*p);
- }
- ***************
- *** 74,80 ****
- p = db[i].db_lines[j];
- q = buf;
-
- ! while (*p != NULL) {
- *q++ = isupper(*p) ? tolower(*p) : *p;
- p++;
- }
- --- 74,80 ----
- p = db[i].db_lines[j];
- q = buf;
-
- ! while (*p != 0) {
- *q++ = isupper(*p) ? tolower(*p) : *p;
- p++;
- }
- ***************
- *** 109,111 ****
- --- 109,148 ----
- return(code);
- }
-
- +
- + #ifdef SYSV
- +
- + static char* re;
- +
- + char* re_comp(s)
- + char* s;
- + {
- + extern char* regcmp();
- +
- + if (s == 0 || !*s)
- + return;
- +
- + if (re)
- + free(re);
- +
- + re = regcmp(s, 0);
- +
- + return (re ? 0 : "Regex compile error");
- + }
- +
- + re_exec(s)
- + char* s;
- + {
- + extern char* regex();
- +
- + char* match;
- +
- + if (!re)
- + return -1;
- +
- + match = regex(re, s);
- +
- + return (match && !*match);
- + }
- +
- + #endif
- *** selectdb.c.orig Wed Nov 4 22:04:34 1992
- --- selectdb.c Tue Nov 10 22:59:53 1992
- ***************
- *** 16,23 ****
- * Initial revision
- *
- */
- ! #include <sys/param.h>
- ! #include <sys/dir.h>
- #include <curses.h>
- #include <stdio.h>
- #include "defs.h"
- --- 16,22 ----
- * Initial revision
- *
- */
- ! #include <dirent.h>
- #include <curses.h>
- #include <stdio.h>
- #include "defs.h"
- ***************
- *** 62,69 ****
- /*
- * Prompt for the name of a database.
- */
- ! while (*dbname == '\0')
- ! prompt_str(spread+2, 0, "Select a database: ", dbname);
-
- /*
- * If the database exists, return its name.
- --- 61,73 ----
- /*
- * Prompt for the name of a database.
- */
- ! prompt_str(spread+2, 0, "Select a database: ", dbname);
- ! if (*dbname == '\0')
- ! {
- ! reset_modes();
- ! printf("\nExiting - no database sepecified!\n");
- ! exit (1);
- ! }
-
- /*
- * If the database exists, return its name.
- ***************
- *** 88,97 ****
- {
- DIR *dp;
- int ndbs;
- ! char *rindex();
- register char *s;
- extern int compare();
- ! register struct direct *d;
-
- ndbs = 0;
-
- --- 92,101 ----
- {
- DIR *dp;
- int ndbs;
- ! char *strrchr();
- register char *s;
- extern int compare();
- ! register struct dirent *d;
-
- ndbs = 0;
-
- ***************
- *** 111,117 ****
- * Search for a "." in the name, which marks
- * the suffix.
- */
- ! if ((s = rindex(d->d_name, '.')) == NULL)
- continue;
-
- /*
- --- 115,121 ----
- * Search for a "." in the name, which marks
- * the suffix.
- */
- ! if ((s = strrchr(d->d_name, '.')) == NULL)
- continue;
-
- /*
-