diff --git a/build/ramdisk.py b/build/ramdisk.py index 5607b6b8d..e3dee1160 100755 --- a/build/ramdisk.py +++ b/build/ramdisk.py @@ -110,9 +110,7 @@ count += 1 rec, orig_filename = filename - c_filename = orig_filename - c_filename = re.sub("-", "_", c_filename) - c_filename = re.sub("\.", "_", c_filename) + c_filename = re.sub(r'[\-\.]', "_", orig_filename) rel_path_filename = os.path.join(folder, orig_filename) with open("src/ramdisk_data_{}.S".format(ram_file), "a") as myfile: @@ -151,9 +149,7 @@ count += 1 rec, orig_filename = filename - c_filename = orig_filename - c_filename = re.sub("-", "_", c_filename) - c_filename = re.sub("\.", "_", c_filename) + c_filename = re.sub(r'[\-\.]', "_", orig_filename) rel_path_filename = os.path.join(folder, orig_filename) myfile.write(" {\n")