From c4c49ffbb33c5117281d280db043233f371abe7b Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 7 Feb 2014 10:56:24 -0600 Subject: [PATCH] More changes for a correct NSH Windows natvie build --- Make.defs | 11 ++++++++++- nshlib/nsh_parse.c | 4 ++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Make.defs b/Make.defs index f7e6aa08d..bdc36e748 100644 --- a/Make.defs +++ b/Make.defs @@ -2,7 +2,7 @@ # apps/Make.defs # Common make definitions provided to all applications # -# Copyright (C) 2011 Gregory Nutt. All rights reserved. +# Copyright (C) 2011, 2014 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -42,9 +42,18 @@ else DEPCONFIG = $(TOPDIR)$(DELIM).config $(APPDIR)$(DELIM).config endif +ifeq ($(CONFIG_WINDOWS_NATIVE),y) +define REGISTER + $(Q) echo Register: $1 + $(Q) echo { "$1", $2, $3, $4 }, > "$(BUILTIN_REGISTRY)$(DELIM)$4.bdat" + $(Q) echo int $4(int argc, char *argv[]); > "$(BUILTIN_REGISTRY)$(DELIM)$4.pdat" + $(Q) touch $(BUILTIN_REGISTRY)$(DELIM).updated" +endef +else define REGISTER $(Q) echo "Register: $1" $(Q) echo "{ \"$1\", $2, $3, $4 }," > "$(BUILTIN_REGISTRY)$(DELIM)$4.bdat" $(Q) echo "int $4(int argc, char *argv[]);" > "$(BUILTIN_REGISTRY)$(DELIM)$4.pdat" $(Q) touch "$(BUILTIN_REGISTRY)$(DELIM).updated" endef +endif diff --git a/nshlib/nsh_parse.c b/nshlib/nsh_parse.c index 9641cd416..45e3b8508 100644 --- a/nshlib/nsh_parse.c +++ b/nshlib/nsh_parse.c @@ -1168,7 +1168,11 @@ static FAR char *nsh_argexpand(FAR struct nsh_vtbl_s *vtbl, FAR char *cmdline, argument = nsh_strcat(vtbl, argument, envstr); *allocation = argument; } + else #endif + { + /* Just to catch any dangling else clauses */ + } } }