Subversion Repositories Kolibri OS

Rev

Rev 6758 | Rev 6792 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6758 Rev 6787
Line 3... Line 3...
3
;; Copyright (C) KolibriOS team 2004-2016. All rights reserved. ;;
3
;; Copyright (C) KolibriOS team 2004-2016. All rights reserved. ;;
4
;;  Distributed under terms of the GNU General Public License.  ;;
4
;;  Distributed under terms of the GNU General Public License.  ;;
5
;;                                                              ;;
5
;;                                                              ;;
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 7... Line 7...
7
 
7
 
Line 8... Line 8...
8
$Revision: 6758 $
8
$Revision: 6787 $
9
 
9
 
10
ERROR_SUCCESS        = 0
10
ERROR_SUCCESS        = 0
11
ERROR_DISK_BASE      = 1
11
ERROR_DISK_BASE      = 1
Line 543... Line 543...
543
        cmp     byte [ebx], 2
543
        cmp     byte [ebx], 2
544
        jz      .utf16
544
        jz      .utf16
545
        cmp     byte [ebx], 3
545
        cmp     byte [ebx], 3
546
        jz      .utf8
546
        jz      .utf8
547
        call    cp866toUTF8_string
547
        call    cp866toUTF8_string
548
        jns     .ret
548
        jns     .end
549
        jmp     .fail
549
        jmp     .fail
Line 550... Line 550...
550
 
550
 
551
.utf8:
551
.utf8:
552
        dec     ecx
552
        dec     ecx
553
        js      .fail
553
        js      .fail
554
        lodsb
554
        lodsb
555
        stosb
555
        stosb
556
        test    al, al
556
        test    al, al
557
        jz      .ret
557
        jz      .end
Line 558... Line 558...
558
        jmp     .utf8
558
        jmp     .utf8
559
 
559
 
560
.utf16:
560
.utf16:
561
        call    UTF16to8_string
561
        call    UTF16to8_string
562
        jns     .ret
562
        jns     .end
563
.fail:
563
.fail:
564
        mov     byte [edi], 0
564
        mov     byte [edi], 0
565
        xor     eax, eax
565
        xor     eax, eax
Line 578... Line 578...
578
        mov     edi, [esp+12]
578
        mov     edi, [esp+12]
579
        jecxz   .fail
579
        jecxz   .fail
580
        cmp     byte [ebx], 0
580
        cmp     byte [ebx], 0
581
        jz      .set_ok
581
        jz      .set_ok
582
        cmp     byte [ebx], 4
582
        cmp     byte [ebx], 4
583
        jnc     .relative
-
 
584
        inc     ebx
-
 
585
        cmp     byte [ebx-1], 2
-
 
586
        jz      .relative16
-
 
587
.relative:
-
 
588
        cmp     byte [ebx], 0
-
 
589
        jz      .set_ok
-
 
590
        cmp     word [ebx], '.'
-
 
591
        jz      .set_ok
-
 
592
        cmp     word [ebx], './'
-
 
593
        jz      .next
-
 
594
        cmp     word [ebx], '..'
-
 
595
        jnz     .doset_relative
-
 
596
        cmp     byte [ebx+2], 0
-
 
597
        jz      @f
583
        jnc     @f
598
        cmp     byte [ebx+2], '/'
-
 
599
        jnz     .doset_relative
-
 
600
        inc     ebx
584
        inc     ebx
601
@@:
585
@@:
602
        dec     esi
-
 
603
        cmp     byte [esi], '/'
-
 
604
        jnz     @b
-
 
605
.next:
-
 
606
        add     ebx, 2
-
 
607
        jmp     .relative
-
 
608
 
-
 
609
.set_ok:
-
 
610
        cmp     edx, edi    ; is destination equal to cur_dir?
-
 
611
        jz      @f
-
 
612
        mov     ecx, esi
-
 
613
        sub     ecx, edx
-
 
614
        mov     esi, edx
-
 
615
        rep movsb
-
 
616
        mov     byte [edi], 0
-
 
617
.ret:
-
 
618
        mov     al, 1
-
 
619
        pop     ebx ebp
-
 
620
        ret     8
-
 
621
 
-
 
622
@@:
-
 
623
        mov     byte [esi], 0
-
 
624
        jmp     .ret
-
 
625
 
-
 
626
.doset_relative:
-
 
627
        cmp     edx, edi    ; is destination equal to cur_dir?
586
        cmp     edx, edi    ; is destination equal to cur_dir?
628
        mov     edi, esi
587
        mov     edi, esi
629
        jz      @f
588
        jz      @f
630
        mov     edi, [esp+12]
589
        mov     edi, [esp+12]
631
        mov     ecx, esi
590
        mov     ecx, esi
Line 641... Line 600...
641
        add     ecx, [esp+16]
600
        add     ecx, [esp+16]
642
        sub     ecx, edi
601
        sub     ecx, edi
643
        mov     ebx, [esp]
602
        mov     ebx, [esp]
644
        jmp     .absolute
603
        jmp     .absolute
Line 645... Line 604...
645
 
604
 
646
.relative16:
-
 
647
        cmp     word [ebx], 0
-
 
648
        jz      .set_ok
-
 
649
        cmp     word [ebx], '.'
-
 
650
        jnz     .doset_relative
-
 
651
        cmp     word [ebx+2], 0
-
 
652
        jz      .set_ok
-
 
653
        cmp     word [ebx+2], '/'
-
 
654
        jz      .next16
-
 
655
        cmp     word [ebx+2], '.'
605
.set_ok:
656
        jnz     .doset_relative
-
 
657
        cmp     word [ebx+4], 0
606
        cmp     edx, edi    ; is destination equal to cur_dir?
658
        jz      @f
607
        jz      @f
659
        cmp     word [ebx+4], '/'
608
        mov     ecx, esi
660
        jnz     .doset_relative
609
        sub     ecx, edx
-
 
610
        mov     esi, edx
-
 
611
        rep movsb
661
        add     ebx, 2
612
        mov     byte [edi], 0
-
 
613
@@:
-
 
614
        mov     al, 1
-
 
615
        pop     ebx ebp
-
 
616
        ret     8
-
 
617
 
-
 
618
.end:
-
 
619
        or      ecx, -1
-
 
620
        mov     edi, [esp+12]
-
 
621
        xor     eax, eax
-
 
622
        push    edi
-
 
623
        repnz scasb
662
@@:
624
        not     ecx
-
 
625
        pop     edi
-
 
626
.parse:
-
 
627
        mov     al, '/'
-
 
628
        repnz scasb
-
 
629
        jecxz   @b
-
 
630
        cmp     byte [edi], '.'
-
 
631
        jnz     .parse
-
 
632
        mov     esi, edi
-
 
633
@@:
-
 
634
        lodsw
-
 
635
        sub     ecx, 2
-
 
636
        cmp     ax, './'
-
 
637
        jz      @b
-
 
638
        cmp     ax, '..'
663
        dec     esi
639
        jnz     @f
664
        cmp     byte [esi], '/'
640
        cmp     byte [esi], '/'
-
 
641
        jnz     @f
-
 
642
        mov     edx, ecx
-
 
643
        mov     ecx, edi
-
 
644
        sub     ecx, [esp+12]
-
 
645
        sub     ecx, 2
-
 
646
        jc      .fail
-
 
647
        sub     edi, 2
-
 
648
        lodsb
-
 
649
        dec     edx
-
 
650
        std
-
 
651
        repnz scasb
-
 
652
        cld
-
 
653
        add     edi, 2
-
 
654
        mov     ecx, edx
-
 
655
        jmp     @b
665
        jnz     @b
656
 
-
 
657
@@:
666
.next16:
658
        sub     esi, 2
-
 
659
        add     ecx, 2
-
 
660
        cmp     esi, edi
-
 
661
        jz      .parse
-
 
662
        push    edi ecx
-
 
663
        rep movsb
667
        add     ebx, 4
664
        pop     ecx edi
Line 668... Line 665...
668
        jmp     .relative16
665
        jmp     .parse
669
 
666
 
670
include "parse_fn.inc"
667
include "parse_fn.inc"
671
include "fs_common.inc"
668
include "fs_common.inc"