confdata.c (f81483aaeb59da530b286fe5d081e1705eb5c886) confdata.c (129ab0d2d9f38b9d43df35235fc66c6740d6928b)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>
4 */
5
6#include <sys/mman.h>
7#include <sys/stat.h>
8#include <sys/types.h>

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

239 sym->flags |= def_flags;
240 break;
241 }
242 if (def != S_DEF_AUTO)
243 conf_warning("symbol value '%s' invalid for %s",
244 p, sym->name);
245 return 1;
246 case S_STRING:
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>
4 */
5
6#include <sys/mman.h>
7#include <sys/stat.h>
8#include <sys/types.h>

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

239 sym->flags |= def_flags;
240 break;
241 }
242 if (def != S_DEF_AUTO)
243 conf_warning("symbol value '%s' invalid for %s",
244 p, sym->name);
245 return 1;
246 case S_STRING:
247 if (*p++ != '"')
248 break;
249 for (p2 = p; (p2 = strpbrk(p2, "\"\\")); p2++) {
250 if (*p2 == '"') {
251 *p2 = 0;
247 /* No escaping for S_DEF_AUTO (include/config/auto.conf) */
248 if (def != S_DEF_AUTO) {
249 if (*p++ != '"')
252 break;
250 break;
251 for (p2 = p; (p2 = strpbrk(p2, "\"\\")); p2++) {
252 if (*p2 == '"') {
253 *p2 = 0;
254 break;
255 }
256 memmove(p2, p2 + 1, strlen(p2));
253 }
257 }
254 memmove(p2, p2 + 1, strlen(p2));
255 }
256 if (!p2) {
257 if (def != S_DEF_AUTO)
258 if (!p2) {
258 conf_warning("invalid string found");
259 conf_warning("invalid string found");
259 return 1;
260 return 1;
261 }
260 }
261 /* fall through */
262 case S_INT:
263 case S_HEX:
264 if (sym_string_valid(sym, p)) {
265 sym->def[def].val = xstrdup(p);
266 sym->flags |= def_flags;
267 } else {

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

695
696static void print_symbol_for_dotconfig(FILE *fp, struct symbol *sym)
697{
698 __print_symbol(fp, sym, OUTPUT_N_AS_UNSET, true);
699}
700
701static void print_symbol_for_autoconf(FILE *fp, struct symbol *sym)
702{
262 }
263 /* fall through */
264 case S_INT:
265 case S_HEX:
266 if (sym_string_valid(sym, p)) {
267 sym->def[def].val = xstrdup(p);
268 sym->flags |= def_flags;
269 } else {

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

697
698static void print_symbol_for_dotconfig(FILE *fp, struct symbol *sym)
699{
700 __print_symbol(fp, sym, OUTPUT_N_AS_UNSET, true);
701}
702
703static void print_symbol_for_autoconf(FILE *fp, struct symbol *sym)
704{
703 __print_symbol(fp, sym, OUTPUT_N_NONE, true);
705 __print_symbol(fp, sym, OUTPUT_N_NONE, false);
704}
705
706void print_symbol_for_listconfig(struct symbol *sym)
707{
708 __print_symbol(stdout, sym, OUTPUT_N, true);
709}
710
711static void print_symbol_for_c(FILE *fp, struct symbol *sym)

--- 474 unchanged lines hidden ---
706}
707
708void print_symbol_for_listconfig(struct symbol *sym)
709{
710 __print_symbol(stdout, sym, OUTPUT_N, true);
711}
712
713static void print_symbol_for_c(FILE *fp, struct symbol *sym)

--- 474 unchanged lines hidden ---