Deleted Added
full compact
wordexp.c (108288) wordexp.c (108299)
1/*-
2 * Copyright (c) 2002 Tim J. Robbins.
3 * 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

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

32#include <paths.h>
33#include <stdio.h>
34#include <stdlib.h>
35#include <string.h>
36#include <unistd.h>
37#include <wordexp.h>
38#include "un-namespace.h"
39
1/*-
2 * Copyright (c) 2002 Tim J. Robbins.
3 * 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

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

32#include <paths.h>
33#include <stdio.h>
34#include <stdlib.h>
35#include <string.h>
36#include <unistd.h>
37#include <wordexp.h>
38#include "un-namespace.h"
39
40__FBSDID("$FreeBSD: head/lib/libc/gen/wordexp.c 108288 2002-12-26 14:34:18Z tjr $");
40__FBSDID("$FreeBSD: head/lib/libc/gen/wordexp.c 108299 2002-12-27 01:01:03Z tjr $");
41
42static int we_askshell(const char *, wordexp_t *, int);
43static int we_check(const char *, int);
44
45/*
46 * wordexp --
47 * Perform shell word expansion on `words' and place the resulting list
48 * of words in `we'. See wordexp(3).

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

205}
206
207/*
208 * we_check --
209 * Check that the string contains none of the following unquoted
210 * special characters: <newline> |&;<>(){}
211 * or command substitutions when WRDE_NOCMD is set in flags.
212 */
41
42static int we_askshell(const char *, wordexp_t *, int);
43static int we_check(const char *, int);
44
45/*
46 * wordexp --
47 * Perform shell word expansion on `words' and place the resulting list
48 * of words in `we'. See wordexp(3).

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

205}
206
207/*
208 * we_check --
209 * Check that the string contains none of the following unquoted
210 * special characters: <newline> |&;<>(){}
211 * or command substitutions when WRDE_NOCMD is set in flags.
212 */
213int
213static int
214we_check(const char *words, int flags)
215{
216 char c;
217 int dquote, level, quote, squote;
218
219 quote = squote = dquote = 0;
220 while ((c = *words++) != '\0') {
221 switch (c) {

--- 87 unchanged lines hidden ---
214we_check(const char *words, int flags)
215{
216 char c;
217 int dquote, level, quote, squote;
218
219 quote = squote = dquote = 0;
220 while ((c = *words++) != '\0') {
221 switch (c) {

--- 87 unchanged lines hidden ---