diff options
| author | neonloop | 2021-08-04 22:40:32 +0000 | 
|---|---|---|
| committer | neonloop | 2021-08-04 22:40:32 +0000 | 
| commit | b148bcce05254c7ebe0ad855e5f1e958968a0bb9 (patch) | |
| tree | cfd96aa5a7eefaf20684c32943034652b713f3ce | |
| parent | 2316cdca56925fab2f3faf6acb451fdaafb9f362 (diff) | |
| download | picoarch-b148bcce05254c7ebe0ad855e5f1e958968a0bb9.tar.gz picoarch-b148bcce05254c7ebe0ad855e5f1e958968a0bb9.tar.bz2 picoarch-b148bcce05254c7ebe0ad855e5f1e958968a0bb9.zip | |
Only wrap option info if it exists
| -rw-r--r-- | Makefile | 6 | ||||
| -rw-r--r-- | options.c | 18 | 
2 files changed, 14 insertions, 10 deletions
| @@ -70,17 +70,19 @@ define CORE_template =  $1_REPO ?= https://github.com/libretro/$(1)/ +$1_MAKE = make $(and $($1_MAKEFILE),-f $($1_MAKEFILE)) platform=$(platform) $(and $(DEBUG),DEBUG=$(DEBUG)) $(and $(PROFILE),PROFILE=$(PROFILE)) $($(1)_FLAGS) +  $(1):  	git clone $(if $($1_REVISION),,--depth 1) $$($(1)_REPO) $(1)  	$(if $1_REVISION,cd $(1) && git checkout $($1_REVISION),)  	(test ! -d patches/$(1)) || (cd $(1) && $(foreach patch, $(sort $(wildcard patches/$(1)/*.patch)), patch -p1 < ../$(patch) &&) true)  $(1)_libretro.so: $(1) -	cd $(1) && make platform=$(platform) $(if $(DEBUG),DEBUG=$(DEBUG),) $(if $(PROFILE),PROFILE=$(PROFILE),) $($(1)_FLAGS) +	cd $(1) && $$($1_MAKE)  	cp $(1)/$(1)_libretro.so .  clean-$(1): -	test ! -d $(1) || cd $(1) && make platform=$(platform) clean +	test ! -d $(1) || cd $(1) && $$($1_MAKE) clean  	rm -f $(1)_libretro.so  endef @@ -105,15 +105,17 @@ void options_init(const struct retro_core_option_definition *defs) {  		strncpy(entry->desc, entry->def->desc, len);  		truncate(entry->desc, MAX_DESC_LEN); -		len = strlen(entry->def->info) + 1; -		entry->info = (char *)calloc(len, sizeof(char)); -		if (!entry->info) { -			PA_ERROR("Error allocating description string\n"); -			options_free(); -			return; +		if (entry->def->info) { +			len = strlen(entry->def->info) + 1; +			entry->info = (char *)calloc(len, sizeof(char)); +			if (!entry->info) { +				PA_ERROR("Error allocating description string\n"); +				options_free(); +				return; +			} +			strncpy(entry->info, entry->def->info, len); +			wrap(entry->info, MAX_LINE_LEN, MAX_LINES);  		} -		strncpy(entry->info, entry->def->info, len); -		wrap(entry->info, MAX_LINE_LEN, MAX_LINES);  		for (j = 0; entry->def->values[j].value; j++)  			; | 
