From 893471a42eb4d189cc0ba1dac1864d6f151bccd7 Mon Sep 17 00:00:00 2001 From: David Given Date: Sat, 7 Jan 2017 23:00:52 +0100 Subject: [PATCH] No longer truncate module names at 10 characters when constructing paths; rename some library modules to their full names. --- lang/m2/comp/build.lua | 1 + lang/m2/comp/defmodule.c | 8 ++------ lang/m2/libm2/{Conversion.def => Conversions.def} | 0 lang/m2/libm2/{Conversion.mod => Conversions.mod} | 0 lang/m2/libm2/{RealConver.def => RealConversions.def} | 0 lang/m2/libm2/{RealConver.mod => RealConversions.mod} | 0 6 files changed, 3 insertions(+), 6 deletions(-) rename lang/m2/libm2/{Conversion.def => Conversions.def} (100%) rename lang/m2/libm2/{Conversion.mod => Conversions.mod} (100%) rename lang/m2/libm2/{RealConver.def => RealConversions.def} (100%) rename lang/m2/libm2/{RealConver.mod => RealConversions.mod} (100%) diff --git a/lang/m2/comp/build.lua b/lang/m2/comp/build.lua index 95c4a30d7..4e12d24f7 100644 --- a/lang/m2/comp/build.lua +++ b/lang/m2/comp/build.lua @@ -113,6 +113,7 @@ cprogram { "h+emheaders", "modules+headers", "modules/src/alloc+lib", + "modules/src/data+lib", "modules/src/em_code+lib_k", "modules/src/em_data+lib", "modules/src/em_mes+lib", diff --git a/lang/m2/comp/defmodule.c b/lang/m2/comp/defmodule.c index a164c1939..0ecb1dd2a 100644 --- a/lang/m2/comp/defmodule.c +++ b/lang/m2/comp/defmodule.c @@ -17,6 +17,7 @@ #include #include #include +#include #include "LLlex.h" #include "Lpars.h" @@ -64,12 +65,7 @@ GetFile(name) char* name; /* Try to find a file with basename "name" and extension ".def", in the directories mentioned in "DEFPATH". */ - char buf[15]; - char *strncpy(), *strcat(); - - strncpy(buf, name, 10); - buf[10] = '\0'; /* maximum length */ - strcat(buf, ".def"); + char* buf = aprintf("%s.def", name); DEFPATH[0] = WorkingDir; if (!InsertFile(buf, DEFPATH, &(FileName))) { diff --git a/lang/m2/libm2/Conversion.def b/lang/m2/libm2/Conversions.def similarity index 100% rename from lang/m2/libm2/Conversion.def rename to lang/m2/libm2/Conversions.def diff --git a/lang/m2/libm2/Conversion.mod b/lang/m2/libm2/Conversions.mod similarity index 100% rename from lang/m2/libm2/Conversion.mod rename to lang/m2/libm2/Conversions.mod diff --git a/lang/m2/libm2/RealConver.def b/lang/m2/libm2/RealConversions.def similarity index 100% rename from lang/m2/libm2/RealConver.def rename to lang/m2/libm2/RealConversions.def diff --git a/lang/m2/libm2/RealConver.mod b/lang/m2/libm2/RealConversions.mod similarity index 100% rename from lang/m2/libm2/RealConver.mod rename to lang/m2/libm2/RealConversions.mod