aboutsummaryrefslogtreecommitdiffstats
path: root/com32
diff options
context:
space:
mode:
authorErwan Velu <erwan.velu@free.fr>2009-11-30 12:27:37 +0100
committerErwan Velu <erwan.velu@free.fr>2009-12-04 10:11:16 +0100
commita3e36f364d45ef282c3eca535a588b292e8509cb (patch)
tree75835de74d2a0a6dcae6fa9bcb5742d6c30f58e3 /com32
parent04f2199cc49ae0983e8198842d4ecc72f6a6bdc8 (diff)
downloadsyslinux.git-a3e36f364d45ef282c3eca535a588b292e8509cb.tar.gz
syslinux.git-a3e36f364d45ef282c3eca535a588b292e8509cb.tar.xz
syslinux.git-a3e36f364d45ef282c3eca535a588b292e8509cb.zip
hdt: Using del_multi_spaces for the cpu model
Impact: avoid multi spaces in the cpu model Some cpu vendors like to put multi spaces in the model name. We don't need it for a cleaner & shorter display
Diffstat (limited to 'com32')
-rw-r--r--com32/hdt/hdt-cli-cpu.c2
-rw-r--r--com32/hdt/hdt-common.c5
-rw-r--r--com32/hdt/hdt-menu-processor.c4
3 files changed, 8 insertions, 3 deletions
diff --git a/com32/hdt/hdt-cli-cpu.c b/com32/hdt/hdt-cli-cpu.c
index 2fcea959..683a6b38 100644
--- a/com32/hdt/hdt-cli-cpu.c
+++ b/com32/hdt/hdt-cli-cpu.c
@@ -42,7 +42,7 @@ void main_show_cpu(int argc __unused, char **argv __unused,
detect_dmi(hardware);
more_printf("CPU\n");
more_printf(" Manufacturer : %s \n", hardware->cpu.vendor);
- more_printf(" Product : %s \n", del_multi_spaces(hardware->cpu.model));
+ more_printf(" Product : %s \n", hardware->cpu.model);
more_printf(" CPU Cores : %d \n", hardware->cpu.num_cores);
more_printf(" L2 Cache : %dK\n", hardware->cpu.l2_cache_size);
diff --git a/com32/hdt/hdt-common.c b/com32/hdt/hdt-common.c
index ce594535..59175cec 100644
--- a/com32/hdt/hdt-common.c
+++ b/com32/hdt/hdt-common.c
@@ -535,6 +535,11 @@ void cpu_detect(struct s_hardware *hardware)
if (strlen(remove_spaces(hardware->cpu.model)) == 0)
strncpy(hardware->cpu.model, hardware->dmi.processor.version,
sizeof(hardware->cpu.model));
+
+ /* Some CPUs like to put many spaces in the model name
+ * That makes some weird display in console/menu
+ * Let's remove that mulitple spaces */
+ strncpy(hardware->cpu.model,del_multi_spaces(hardware->cpu.model),sizeof(hardware->cpu.model));
hardware->cpu_detection = true;
}
diff --git a/com32/hdt/hdt-menu-processor.c b/com32/hdt/hdt-menu-processor.c
index b2b8614f..abb9a1af 100644
--- a/com32/hdt/hdt-menu-processor.c
+++ b/com32/hdt/hdt-menu-processor.c
@@ -64,9 +64,9 @@ void compute_processor(struct s_my_menu *menu, struct s_hardware *hardware)
menu->items_count++;
snprintf(buffer, sizeof buffer, "Model : %s",
- del_multi_spaces(hardware->cpu.model));
+ hardware->cpu.model);
snprintf(statbuffer, sizeof statbuffer, "Model: %s",
- del_multi_spaces(hardware->cpu.model));
+ hardware->cpu.model);
add_item(buffer, statbuffer, OPT_INACTIVE, NULL, 0);
menu->items_count++;