alias.c (b97fa2ef508bb1cc99621edb8b6d03845b55b8bd) | alias.c (afb033d5c4f01a464f57fe8e68d741246d9df492) |
---|---|
1/*- 2 * Copyright (c) 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Kenneth Almquist. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 19 unchanged lines hidden (view full) --- 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34 * SUCH DAMAGE. 35 * | 1/*- 2 * Copyright (c) 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Kenneth Almquist. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 19 unchanged lines hidden (view full) --- 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34 * SUCH DAMAGE. 35 * |
36 * $Id$ | 36 * $Id: alias.c,v 1.7 1997/02/22 13:58:20 peter Exp $ |
37 */ 38 39#ifndef lint 40static char const sccsid[] = "@(#)alias.c 8.3 (Berkeley) 5/4/95"; 41#endif /* not lint */ 42 43#include <stdlib.h> 44#include "shell.h" --- 201 unchanged lines hidden (view full) --- 246 for (i = 0; *argptr; argptr++) 247 i = unalias(*argptr); 248 249 return (i); 250} 251 252STATIC struct alias ** 253hashalias(p) | 37 */ 38 39#ifndef lint 40static char const sccsid[] = "@(#)alias.c 8.3 (Berkeley) 5/4/95"; 41#endif /* not lint */ 42 43#include <stdlib.h> 44#include "shell.h" --- 201 unchanged lines hidden (view full) --- 246 for (i = 0; *argptr; argptr++) 247 i = unalias(*argptr); 248 249 return (i); 250} 251 252STATIC struct alias ** 253hashalias(p) |
254 register char *p; | 254 char *p; |
255 { 256 unsigned int hashval; 257 258 hashval = *p << 4; 259 while (*p) 260 hashval+= *p++; 261 return &atab[hashval % ATABSIZE]; 262} | 255 { 256 unsigned int hashval; 257 258 hashval = *p << 4; 259 while (*p) 260 hashval+= *p++; 261 return &atab[hashval % ATABSIZE]; 262} |