lex.c (1591) | lex.c (10067) |
---|---|
1/* 2 * Copyright (c) 1980, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 444 unchanged lines hidden (view full) --- 453 454struct cmd * 455lex(word) 456 char word[]; 457{ 458 register struct cmd *cp; 459 extern struct cmd cmdtab[]; 460 | 1/* 2 * Copyright (c) 1980, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 444 unchanged lines hidden (view full) --- 453 454struct cmd * 455lex(word) 456 char word[]; 457{ 458 register struct cmd *cp; 459 extern struct cmd cmdtab[]; 460 |
461 /* 462 * ignore trailing chars after `#' 463 * 464 * lines with beginning `#' are comments 465 * spaces befor `#' are ignored in execute() 466 */ 467 468 if (*word == '#') 469 *(word+1) = '\0'; 470 471 |
|
461 for (cp = &cmdtab[0]; cp->c_name != NOSTR; cp++) 462 if (isprefix(word, cp->c_name)) 463 return(cp); 464 return(NONE); 465} 466 467/* 468 * Determine if as1 is a valid prefix of as2. --- 197 unchanged lines hidden --- | 472 for (cp = &cmdtab[0]; cp->c_name != NOSTR; cp++) 473 if (isprefix(word, cp->c_name)) 474 return(cp); 475 return(NONE); 476} 477 478/* 479 * Determine if as1 is a valid prefix of as2. --- 197 unchanged lines hidden --- |