Deleted Added
full compact
ed.chared.c (59243) ed.chared.c (61524)
1/* $Header: /src/pub/tcsh/ed.chared.c,v 3.59 1999/08/13 16:34:57 christos Exp $ */
1/* $Header: /src/pub/tcsh/ed.chared.c,v 3.60 2000/06/10 22:07:55 kim Exp $ */
2/*
3 * ed.chared.c: Character editing functions.
4 */
5/*-
6 * Copyright (c) 1980, 1991 The Regents of the University of California.
7 * All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without

--- 61 unchanged lines hidden (view full) ---

71
72 The only difference between the two echo lines is in the first character
73 after the echo command. The result is either one or three arguments.
74
75 */
76
77#include "sh.h"
78
2/*
3 * ed.chared.c: Character editing functions.
4 */
5/*-
6 * Copyright (c) 1980, 1991 The Regents of the University of California.
7 * All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without

--- 61 unchanged lines hidden (view full) ---

71
72 The only difference between the two echo lines is in the first character
73 after the echo command. The result is either one or three arguments.
74
75 */
76
77#include "sh.h"
78
79RCSID("$Id: ed.chared.c,v 3.59 1999/08/13 16:34:57 christos Exp $")
79RCSID("$Id: ed.chared.c,v 3.60 2000/06/10 22:07:55 kim Exp $")
80
81#include "ed.h"
82#include "tw.h"
83#include "ed.defns.h"
84
85/* #define SDEBUG */
86
87#define TCSHOP_NOP 0x00

--- 866 unchanged lines hidden (view full) ---

954 hp = hp->Hnext;
955 }
956
957 if (HistLit && hp->histline) {
958 copyn(InputBuf, hp->histline, INBUFSIZE);
959 CurrentHistLit = 1;
960 }
961 else {
80
81#include "ed.h"
82#include "tw.h"
83#include "ed.defns.h"
84
85/* #define SDEBUG */
86
87#define TCSHOP_NOP 0x00

--- 866 unchanged lines hidden (view full) ---

954 hp = hp->Hnext;
955 }
956
957 if (HistLit && hp->histline) {
958 copyn(InputBuf, hp->histline, INBUFSIZE);
959 CurrentHistLit = 1;
960 }
961 else {
962 (void) sprlex(InputBuf, sizeof(InputBuf), &hp->Hlex);
962 (void) sprlex(InputBuf, sizeof(InputBuf) / sizeof(Char), &hp->Hlex);
963 CurrentHistLit = 0;
964 }
965 LastChar = InputBuf + Strlen(InputBuf);
966
967 if (LastChar > InputBuf) {
968 if (LastChar[-1] == '\n')
969 LastChar--;
970#if 0

--- 728 unchanged lines hidden (view full) ---

1699 copyn(InputBuf, hp->histline, INBUFSIZE);
1700 CurrentHistLit = 1;
1701 }
1702 else {
1703 return CC_ERROR;
1704 }
1705 }
1706 else {
963 CurrentHistLit = 0;
964 }
965 LastChar = InputBuf + Strlen(InputBuf);
966
967 if (LastChar > InputBuf) {
968 if (LastChar[-1] == '\n')
969 LastChar--;
970#if 0

--- 728 unchanged lines hidden (view full) ---

1699 copyn(InputBuf, hp->histline, INBUFSIZE);
1700 CurrentHistLit = 1;
1701 }
1702 else {
1703 return CC_ERROR;
1704 }
1705 }
1706 else {
1707 (void) sprlex(InputBuf, sizeof(InputBuf), &hp->Hlex);
1707 (void) sprlex(InputBuf, sizeof(InputBuf) / sizeof(Char), &hp->Hlex);
1708 CurrentHistLit = 0;
1709 }
1710
1711 LastChar = InputBuf + Strlen(InputBuf);
1712 if (LastChar > InputBuf) {
1713 if (LastChar[-1] == '\n')
1714 LastChar--;
1715 if (LastChar[-1] == ' ')

--- 134 unchanged lines hidden (view full) ---

1850 c_hsetpat(); /* Set search pattern !! */
1851
1852 for (h = 1; h <= Hist_num; h++)
1853 hp = hp->Hnext;
1854
1855 while (hp != NULL) {
1856 Char sbuf[INBUFSIZE], *hl;
1857 if (hp->histline == NULL) {
1708 CurrentHistLit = 0;
1709 }
1710
1711 LastChar = InputBuf + Strlen(InputBuf);
1712 if (LastChar > InputBuf) {
1713 if (LastChar[-1] == '\n')
1714 LastChar--;
1715 if (LastChar[-1] == ' ')

--- 134 unchanged lines hidden (view full) ---

1850 c_hsetpat(); /* Set search pattern !! */
1851
1852 for (h = 1; h <= Hist_num; h++)
1853 hp = hp->Hnext;
1854
1855 while (hp != NULL) {
1856 Char sbuf[INBUFSIZE], *hl;
1857 if (hp->histline == NULL) {
1858 hp->histline = Strsave(sprlex(sbuf, sizeof(sbuf), &hp->Hlex));
1858 hp->histline = Strsave(sprlex(sbuf, sizeof(sbuf) / sizeof(Char),
1859 &hp->Hlex));
1859 }
1860 }
1860 hl = HistLit ? hp->histline : sprlex(sbuf, sizeof(sbuf), &hp->Hlex);
1861 hl = HistLit ? hp->histline : sprlex(sbuf, sizeof(sbuf) / sizeof(Char),
1862 &hp->Hlex);
1861#ifdef SDEBUG
1862 xprintf("Comparing with \"%S\"\n", hl);
1863#endif
1864 if ((Strncmp(hl, InputBuf, (size_t) (LastChar - InputBuf)) ||
1865 hl[LastChar-InputBuf]) && c_hmatch(hl)) {
1866 found++;
1867 break;
1868 }

--- 34 unchanged lines hidden (view full) ---

1903 if (hp == 0)
1904 return(CC_ERROR);
1905
1906 c_hsetpat(); /* Set search pattern !! */
1907
1908 for (h = 1; h < Hist_num && hp; h++) {
1909 Char sbuf[INBUFSIZE], *hl;
1910 if (hp->histline == NULL) {
1863#ifdef SDEBUG
1864 xprintf("Comparing with \"%S\"\n", hl);
1865#endif
1866 if ((Strncmp(hl, InputBuf, (size_t) (LastChar - InputBuf)) ||
1867 hl[LastChar-InputBuf]) && c_hmatch(hl)) {
1868 found++;
1869 break;
1870 }

--- 34 unchanged lines hidden (view full) ---

1905 if (hp == 0)
1906 return(CC_ERROR);
1907
1908 c_hsetpat(); /* Set search pattern !! */
1909
1910 for (h = 1; h < Hist_num && hp; h++) {
1911 Char sbuf[INBUFSIZE], *hl;
1912 if (hp->histline == NULL) {
1911 hp->histline = Strsave(sprlex(sbuf, sizeof(sbuf), &hp->Hlex));
1913 hp->histline = Strsave(sprlex(sbuf, sizeof(sbuf) / sizeof(Char),
1914 &hp->Hlex));
1912 }
1915 }
1913 hl = HistLit ? hp->histline : sprlex(sbuf, sizeof(sbuf), &hp->Hlex);
1916 hl = HistLit ? hp->histline : sprlex(sbuf, sizeof(sbuf) / sizeof(Char),
1917 &hp->Hlex);
1914#ifdef SDEBUG
1915 xprintf("Comparing with \"%S\"\n", hl);
1916#endif
1917 if ((Strncmp(hl, InputBuf, (size_t) (LastChar - InputBuf)) ||
1918 hl[LastChar-InputBuf]) && c_hmatch(hl))
1919 found = h;
1920 hp = hp->Hnext;
1921 }

--- 2084 unchanged lines hidden ---
1918#ifdef SDEBUG
1919 xprintf("Comparing with \"%S\"\n", hl);
1920#endif
1921 if ((Strncmp(hl, InputBuf, (size_t) (LastChar - InputBuf)) ||
1922 hl[LastChar-InputBuf]) && c_hmatch(hl))
1923 found = h;
1924 hp = hp->Hnext;
1925 }

--- 2084 unchanged lines hidden ---