command.c (47858) | command.c (47865) |
---|---|
1/* 2 * PPP User command processing module 3 * 4 * Written by Toshiharu OHNO (tony-o@iij.ad.jp) 5 * 6 * Copyright (C) 1993, Internet Initiative Japan, Inc. All rights reserverd. 7 * 8 * Redistribution and use in source and binary forms are permitted 9 * provided that the above copyright notice and this paragraph are 10 * duplicated in all such forms and that any documentation, 11 * advertising materials, and other materials related to such 12 * distribution and use acknowledge that the software was developed 13 * by the Internet Initiative Japan, Inc. The name of the 14 * IIJ may not be used to endorse or promote products derived 15 * from this software without specific prior written permission. 16 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 17 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 18 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. 19 * | 1/* 2 * PPP User command processing module 3 * 4 * Written by Toshiharu OHNO (tony-o@iij.ad.jp) 5 * 6 * Copyright (C) 1993, Internet Initiative Japan, Inc. All rights reserverd. 7 * 8 * Redistribution and use in source and binary forms are permitted 9 * provided that the above copyright notice and this paragraph are 10 * duplicated in all such forms and that any documentation, 11 * advertising materials, and other materials related to such 12 * distribution and use acknowledge that the software was developed 13 * by the Internet Initiative Japan, Inc. The name of the 14 * IIJ may not be used to endorse or promote products derived 15 * from this software without specific prior written permission. 16 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 17 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 18 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. 19 * |
20 * $Id: command.c,v 1.200 1999/06/09 08:47:32 brian Exp $ | 20 * $Id: command.c,v 1.201 1999/06/09 16:54:02 brian Exp $ |
21 * 22 */ 23#include <sys/param.h> 24#include <netinet/in_systm.h> 25#include <netinet/in.h> 26#include <netinet/ip.h> 27#include <arpa/inet.h> 28#include <sys/socket.h> --- 110 unchanged lines hidden (view full) --- 139#define NEG_PAP 48 140#define NEG_PPPDDEFLATE 49 141#define NEG_PRED1 50 142#define NEG_PROTOCOMP 51 143#define NEG_SHORTSEQ 52 144#define NEG_VJCOMP 53 145 146const char Version[] = "2.22"; | 21 * 22 */ 23#include <sys/param.h> 24#include <netinet/in_systm.h> 25#include <netinet/in.h> 26#include <netinet/ip.h> 27#include <arpa/inet.h> 28#include <sys/socket.h> --- 110 unchanged lines hidden (view full) --- 139#define NEG_PAP 48 140#define NEG_PPPDDEFLATE 49 141#define NEG_PRED1 50 142#define NEG_PROTOCOMP 51 143#define NEG_SHORTSEQ 52 144#define NEG_VJCOMP 53 145 146const char Version[] = "2.22"; |
147const char VersionDate[] = "$Date: 1999/06/09 08:47:32 $"; | 147const char VersionDate[] = "$Date: 1999/06/09 16:54:02 $"; |
148 149static int ShowCommand(struct cmdargs const *); 150static int TerminalCommand(struct cmdargs const *); 151static int QuitCommand(struct cmdargs const *); 152static int OpenCommand(struct cmdargs const *); 153static int CloseCommand(struct cmdargs const *); 154static int DownCommand(struct cmdargs const *); 155static int SetCommand(struct cmdargs const *); --- 193 unchanged lines hidden (view full) --- 349 /* Get the first occurance of the word ``little'' in ``big'' */ 350 char *pos; 351 int len; 352 353 pos = big; 354 len = strlen(little); 355 356 while ((pos = strstr(pos, little)) != NULL) | 148 149static int ShowCommand(struct cmdargs const *); 150static int TerminalCommand(struct cmdargs const *); 151static int QuitCommand(struct cmdargs const *); 152static int OpenCommand(struct cmdargs const *); 153static int CloseCommand(struct cmdargs const *); 154static int DownCommand(struct cmdargs const *); 155static int SetCommand(struct cmdargs const *); --- 193 unchanged lines hidden (view full) --- 349 /* Get the first occurance of the word ``little'' in ``big'' */ 350 char *pos; 351 int len; 352 353 pos = big; 354 len = strlen(little); 355 356 while ((pos = strstr(pos, little)) != NULL) |
357 if ((pos == big || !isinword(pos[-1])) && !isinword(pos[len])) 358 break; 359 else | 357 if ((pos != big && isinword(pos[-1])) || isinword(pos[len])) |
360 pos++; | 358 pos++; |
359 else if (pos != big && pos[-1] == '\\') 360 memmove(pos - 1, pos, strlen(pos) + 1); 361 else 362 break; |
|
361 362 return pos; 363} 364 365static char * 366subst(char *tgt, const char *oldstr, const char *newstr) 367{ 368 /* tgt is a malloc()d area... realloc() as necessary */ --- 2202 unchanged lines hidden --- | 363 364 return pos; 365} 366 367static char * 368subst(char *tgt, const char *oldstr, const char *newstr) 369{ 370 /* tgt is a malloc()d area... realloc() as necessary */ --- 2202 unchanged lines hidden --- |