core: get rid of unmangle_name completely syslinux-4.00-pre31
authorH. Peter Anvin <hpa@zytor.com>
Mon, 1 Mar 2010 05:12:46 +0000 (21:12 -0800)
committerH. Peter Anvin <hpa@zytor.com>
Mon, 1 Mar 2010 05:12:46 +0000 (21:12 -0800)
The notion of "mangle name" is now restricted to producing a canonical
representation, e.g. changing \ -> / for FAT filesystems.  However,
the resulting mangled name is now always human-readable, so there
never is any reason to unmangle a name.

Get rid of not just the mangling, but of the resulting unmangled-name
buffers and so on.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
core/com32.inc
core/comboot.inc
core/extern.inc
core/fs/fs.c
core/fs/newconfig.c
core/include/core.h
core/include/fs.h
core/parsecmd.inc
core/parseconfig.inc
core/runkernel.inc
core/ui.inc

index 6ef0784..9a29c95 100644 (file)
@@ -103,7 +103,7 @@ com32_exit:
                bits 16
                section .text16
 not_com32r:
-               mov si,KernelCName
+               mov si,KernelName
                call writestr
                mov si,not_com32r_msg
                call writestr
index 9537fc0..13daf3e 100644 (file)
@@ -312,7 +312,7 @@ comboot_exit_msg:
                pm_call comboot_cleanup_lowmem
                call adjust_screen      ; The COMBOOT program might have changed the screen
                jcxz .nomsg
-               mov si,KernelCName
+               mov si,KernelName
                call writestr
                mov si,cx
                call writestr
index 3e25226..fbc4759 100644 (file)
@@ -14,7 +14,7 @@
 
        ; fs.c
        extern fs_init, pm_searchdir, getfssec, pm_mangle_name, load_config
-        extern pm_unmangle_name, close_file
+        extern close_file
 
        ; chdir.c
        extern pm_realpath
index 9002fa6..865f398 100644 (file)
@@ -88,17 +88,6 @@ void mangle_name(char *dst, const char *src)
     this_fs->fs_ops->mangle_name(dst, src);
 }
 
-void pm_unmangle_name(com32sys_t *regs)
-{
-    const char *src = MK_PTR(regs->ds, regs->esi.w[0]);
-    char       *dst = MK_PTR(regs->es, regs->edi.w[0]);
-
-    dst = stpcpy(dst, src);
-
-    /* Update the di register to point to the last null char */
-    regs->edi.w[0] = OFFS_WRT(dst, regs->es);
-}
-
 void getfssec(com32sys_t *regs)
 {
     int sectors;
index 08027a3..58c47a5 100644 (file)
@@ -27,7 +27,7 @@ void pm_is_config_file(com32sys_t *regs)
     (void)regs;
 
     /* Save configuration file as an absolute path for posterity */
-    realpath(ConfigName, KernelCName, FILENAME_MAX);
+    realpath(ConfigName, KernelName, FILENAME_MAX);
 
     /* If we got anything on the command line, do a chdir */
     p = cmd_line;
index 50e2be4..48df921 100644 (file)
@@ -14,7 +14,6 @@ extern char ConfigName[];
 extern char KernelName[];
 extern char cmd_line[];
 extern char ConfigFile[];
-extern char KernelCName[];
 
 /* diskstart.inc isolinux.asm*/
 extern void getlinsec(void);
index ed196ac..ef7eb8b 100644 (file)
@@ -199,10 +199,8 @@ static inline struct file *handle_to_file(uint16_t handle)
 
 /* fs.c */
 void pm_mangle_name(com32sys_t *);
-void pm_unmangle_name(com32sys_t *);
 void pm_searchdir(com32sys_t *);
 void mangle_name(char *, const char *);
-char *unmangle_name(char *, const char *);
 int searchdir(const char *name);
 void _close_file(struct file *);
 size_t pmapi_read_file(uint16_t *handle, void *buf, size_t sectors);
index b6a2c82..30cd67f 100644 (file)
@@ -111,7 +111,6 @@ err_badcfg      db 'Unknown keyword in configuration file: ',0
 err_noparm      db 'Missing parameter in configuration file. Keyword: ',0
 
                section .uibss
-                global KernelName
                alignb 4
 vk_size                equ (vk_end + 3) & ~3
 VKernelBuf:    resb vk_size            ; "Current" vkernel
@@ -122,11 +121,8 @@ Onerror            resb max_cmd_len+1      ; onerror
                section .bss16
 KbdMap         resb 256                ; Keyboard map
 FKeyName       resb MAX_FKEYS*FILENAME_MAX     ; File names for F-key help
-InitRDCNameLen resw 1                  ; Length of unmangled initrd name
-               global KernelName, KernelCName
+                global KernelName
 KernelName      resb FILENAME_MAX      ; Mangled name for kernel
-KernelCName     resb FILENAME_MAX      ; Unmangled kernel name
-InitRDCName     resb FILENAME_MAX      ; Unmangled initrd name
 MNameBuf        resb FILENAME_MAX
 InitRD          resb FILENAME_MAX
 
index b30dbc2..e7b3108 100644 (file)
@@ -409,9 +409,8 @@ commit_vk:
                mov cx,7        ; "initrd="
                rep movsb
                mov si,InitRD
-               pm_call pm_unmangle_name
-               mov al,' '
-               stosb
+               call strcpy
+               mov byte [es:di-1],' '
 
                ; For better compression, clean up the append field
 .noinitrd:
index f4dc28e..bf67b11 100644 (file)
@@ -77,7 +77,7 @@ construct_cmdline:
                 mov si,boot_image              ; BOOT_IMAGE=
                 mov cx,boot_image_len
                 rep movsb
-                mov si,KernelCName             ; Unmangled kernel name
+                mov si,KernelName              ; Unmangled kernel name
                call strcpy
                mov byte [es:di-1],' '          ; Follow by space
 
@@ -233,7 +233,7 @@ new_kernel:
 any_kernel:
                mov si,loading_msg
                 call writestr_qchk
-                mov si,KernelCName             ; Print kernel name part of
+                mov si,KernelName              ; Print kernel name part of
                 call writestr_qchk             ; "Loading" message
 
 ;
@@ -589,11 +589,6 @@ loadinitrd:
                mov ds,ax
                mov es,ax
                push edi
-                mov si,InitRD
-                mov di,InitRDCName
-                pm_call pm_unmangle_name             ; Create human-readable name
-                sub di,InitRDCName
-                mov [InitRDCNameLen],di
                 mov di,InitRD
                 pm_call pm_searchdir                  ; Look for it in directory
                pop edi
@@ -602,7 +597,7 @@ loadinitrd:
                push si
                mov si,crlfloading_msg          ; Write "Loading "
                call writestr_qchk
-                mov si,InitRDCName             ; Write ramdisk name
+                mov si,InitRD                  ; Write ramdisk name
                 call writestr_qchk
                 mov si,dotdot_msg              ; Write dots
                 call writestr_qchk
@@ -621,7 +616,7 @@ loadinitrd:
 .notthere:
                 mov si,err_noinitrd
                 call writestr
-                mov si,InitRDCName
+                mov si,InitRD
                 call writestr
                 mov si,crlf_msg
                 jmp abort_load
index 5fe3e53..d60d5ca 100644 (file)
@@ -486,13 +486,9 @@ bad_kernel:
                and cx,cx
                jnz on_error
 .really:
-               mov si,KernelName
-                mov di,KernelCName
-               push di
-                pm_call pm_unmangle_name              ; Get human form
                mov si,err_notfound             ; Complain about missing kernel
                call writestr
-               pop si                          ; KernelCName
+               mov si,KernelName
                 call writestr
                 mov si,crlf_msg
                 jmp abort_load                  ; Ask user for clue
@@ -616,10 +612,6 @@ kernel_good:
                mov [KeepPXE],al
 %endif
 
-               mov si,KernelName
-               mov di,KernelCName
-               pm_call pm_unmangle_name
-
                ; Default memory limit, can be overridden by image loaders
                mov eax,[HighMemRsvd]
                mov [MyHighMemSize],eax