parser.c (199660) | parser.c (200956) |
---|---|
1/*- 2 * Copyright (c) 1991, 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 --- 22 unchanged lines hidden (view full) --- 31 */ 32 33#ifndef lint 34#if 0 35static char sccsid[] = "@(#)parser.c 8.7 (Berkeley) 5/16/95"; 36#endif 37#endif /* not lint */ 38#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1991, 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 --- 22 unchanged lines hidden (view full) --- 31 */ 32 33#ifndef lint 34#if 0 35static char sccsid[] = "@(#)parser.c 8.7 (Berkeley) 5/16/95"; 36#endif 37#endif /* not lint */ 38#include <sys/cdefs.h> |
39__FBSDID("$FreeBSD: head/bin/sh/parser.c 199660 2009-11-22 18:23:30Z jilles $"); | 39__FBSDID("$FreeBSD: head/bin/sh/parser.c 200956 2009-12-24 18:41:14Z jilles $"); |
40 41#include <stdlib.h> 42#include <unistd.h> 43 44#include "shell.h" 45#include "parser.h" 46#include "nodes.h" 47#include "expand.h" /* defines rmescapes() */ --- 1457 unchanged lines hidden (view full) --- 1505 1506 1507/* 1508 * Return true if the argument is a legal variable name (a letter or 1509 * underscore followed by zero or more letters, underscores, and digits). 1510 */ 1511 1512int | 40 41#include <stdlib.h> 42#include <unistd.h> 43 44#include "shell.h" 45#include "parser.h" 46#include "nodes.h" 47#include "expand.h" /* defines rmescapes() */ --- 1457 unchanged lines hidden (view full) --- 1505 1506 1507/* 1508 * Return true if the argument is a legal variable name (a letter or 1509 * underscore followed by zero or more letters, underscores, and digits). 1510 */ 1511 1512int |
1513goodname(char *name) | 1513goodname(const char *name) |
1514{ | 1514{ |
1515 char *p; | 1515 const char *p; |
1516 1517 p = name; 1518 if (! is_name(*p)) 1519 return 0; 1520 while (*++p) { 1521 if (! is_in_name(*p)) 1522 return 0; 1523 } --- 152 unchanged lines hidden --- | 1516 1517 p = name; 1518 if (! is_name(*p)) 1519 return 0; 1520 while (*++p) { 1521 if (! is_in_name(*p)) 1522 return 0; 1523 } --- 152 unchanged lines hidden --- |