From 9a45b800179efca8177678740ce9020390c0fd0e Mon Sep 17 00:00:00 2001 From: Simon John Date: Mon, 19 May 2014 22:09:00 +0100 Subject: [PATCH] Check that on windows ARDUINO_DIR (and MPIDE_DIR) is a relative path. Checks for paths starting with / e.g. /cydrive/arduino or a drive letter e.g. C:\Program Files\Arduino Fix #201 Fix #202 --- Arduino.mk | 6 ++++++ HISTORY.md | 1 + chipKIT.mk | 6 ++++++ 3 files changed, 13 insertions(+) diff --git a/Arduino.mk b/Arduino.mk index a352628..42dfef0 100644 --- a/Arduino.mk +++ b/Arduino.mk @@ -279,6 +279,12 @@ else $(call show_config_variable,ARDUINO_DIR,[USER]) endif +ifeq ($(CURRENT_OS),WINDOWS) + ifneq ($(shell echo $(ARDUINO_DIR) | egrep '^(/|[a-zA-Z]:\\)'),) + echo $(error On Windows, ARDUINO_DIR must be a relative path) + endif +endif + ######################################################################## # Default TARGET to pwd (ex Daniele Vergini) diff --git a/HISTORY.md b/HISTORY.md index d20f7da..632753a 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -8,6 +8,7 @@ I tried to give credit whenever possible. If I have missed anyone, kindly add it - Tweak: Allow spaces in "Serial.begin (....)". (Issue #190) (https://github.com/pdav) - Add: Add support for compiling assembler code. (Issue #195) (https://github.com/hrobeers) - Add: Try to guess port from wildcards if not specified. (Issue #197) (https://github.com/tuzz) +- Fix: Check that on windows ARDUINO_DIR (and MPIDE_DIR) is a relative path. (Issue #201 and #202) (https://github.com/sej7278) ### 1.3.3 (2014-04-12) - Fix: Make a new manpage for ard-reset-arduino. Fixes issue #188 (https://github.com/sej7278) diff --git a/chipKIT.mk b/chipKIT.mk index 19a4a4a..06d85e3 100644 --- a/chipKIT.mk +++ b/chipKIT.mk @@ -47,6 +47,12 @@ else $(call show_config_variable,MPIDE_DIR,[USER]) endif +ifeq ($(CURRENT_OS),WINDOWS) + ifneq ($(shell echo $(ARDUINO_DIR) | egrep '^(/|[a-zA-Z]:\\)'),) + echo $(error On Windows, MPIDE_DIR must be a relative path) + endif +endif + ifndef MPIDE_PREFERENCES_PATH AUTO_MPIDE_PREFERENCES_PATH := $(firstword \ $(call dir_if_exists,$(HOME)/.mpide/preferences.txt) \