--------------------------------------------------------------------------------------------
                      [ENHANCED] VFP 9.0 FIX - THE MAXIMUM NUMBER OF CHARACTERS FOR THE SET PATH COMMAND
                                 January 2024
                 --------------------------------------------------------------------------------------------
                                    CCB



1. BUG:

     In vfp9 (and vfp6, vfp7, vfp8), the maximum number of characters for the SET PATH command (and the SET("PATH") function) is 4095,
     now the maximum number of characters for the SET PATH command (and the SET("PATH") function) is 8191.


2. CAUSE:

     There are some BUGs in the following code.


3. RESOLUTION:

     We can write some code to fix the BUG.

     Label4b66d6 ::
             inc ebx                                                         ;0x004b66d6 :        43
             cmp  byte ptr [ebx] , 0FEh                                      ;0x004b66d7 :        803bfe
             mov  dword ptr [ Data9393ac ] , ebx                             ;0x004b66da :        891dac939300
             je Label5e1c10                                                  ;0x004b66e0 :        0f842ab51200
             xor eax , eax                                                   ;0x004b66e6 :        33c0
             call Fun42c118                                                  ;0x004b66e8 :        e82b5af7ff
             mov eax , esp                                                   ;0x004b66ed :        8bc4
             sub  eax , dword ptr [ Data9370c4 ]                             ;0x004b66ef :        2b05c4709300


     ;
     ;                 ---------------------------------------------------------------------------------
     ;                      VFP 9.0 FIX - THE MAXIMUM NUMBER OF CHARACTERS FOR THE SET PATH COMMAND
     ;                                November 2019
     ;                 ---------------------------------------------------------------------------------
     ;                                     CCB
     ;
     ; In vfp9, the maximum number of characters for the SET PATH command (and the SET("PATH") function) is 4095,
     ; now the maximum number of characters for the SET PATH command (and the SET("PATH") function) is 8191.
     ;
     ; 2019/11/20, by ccb
     ;

     ;         mov esi , 01000h                                                ;0x004b66f5 :        be00100000
             mov esi , 02000h                                                ;0x004b66f5 :        be00100000


             cmp eax , esi                                                   ;0x004b66fa :        3bc6
             jle Label5e1c2d                                                 ;0x004b66fc :        0f8e2bb51200
             mov eax , esi                                                   ;0x004b6702 :        8bc6
             call Fun42c118                                                  ;0x004b6704 :        e80f5af7ff
             mov  dword ptr [ ebp + 0FFFFFC30h ] , esp                       ;0x004b6709 :        89a530fcffff

     Label4b670f ::
             mov  ebx , dword ptr [ ebp + 0FFFFFC30h ]                       ;0x004b670f :        8b9d30fcffff
             test ebx , ebx                                                  ;0x004b6715 :        85db
             mov edi , 0B6h                                                  ;0x004b6717 :        bfb6000000
             je Label5e1c39                                                  ;0x004b671c :        0f8417b51200
             pushd 00h                                                       ;0x004b6722 :        6a00
             push ebx                                                        ;0x004b6724 :        53
             mov eax , esi                                                   ;0x004b6725 :        8bc6
             call Fun5463b6                                                  ;0x004b6727 :        e88afc0800
             cmp  byte ptr [ Data93a8c0 ] , 00h                              ;0x004b672c :        803dc0a8930000
             je Label4b6742                                                  ;0x004b6733 :        740d
             call Fun4b837c                                                  ;0x004b6735 :        e8421c0000
             test eax , eax                                                  ;0x004b673a :        85c0
             jne Label5e1c40                                                 ;0x004b673c :        0f85feb41200

     Label4b6742 ::
             mov eax , ebx                                                   ;0x004b6742 :        8bc3
             lea edx ,  dword ptr [ eax + 1 ]                                ;0x004b6744 :        8d5001

     Label4b6747 ::
             mov  cl , byte ptr [eax]                                        ;0x004b6747 :        8a08
             inc eax                                                         ;0x004b6749 :        40
             test cl , cl                                                    ;0x004b674a :        84c9
             jne Label4b6747                                                 ;0x004b674c :        75f9


     ;
     ;                 ---------------------------------------------------------------------------------
     ;                      VFP 9.0 FIX - THE MAXIMUM NUMBER OF CHARACTERS FOR THE SET PATH COMMAND
     ;                                November 2019
     ;                 ---------------------------------------------------------------------------------
     ;                                     CCB
     ;
     ; In vfp9, the maximum number of characters for the SET PATH command (and the SET("PATH") function) is 4095,
     ; now the maximum number of characters for the SET PATH command (and the SET("PATH") function) is 8191.
     ;
     ; 2019/11/20, by ccb
     ;

     ;         mov dword ptr vfpa_setpath_issetpath,01h


             sub eax , edx                                                   ;0x004b674e :        2bc2
             mov edi , offset Data93a8c0                                              ;0x004b6750 :        bfc0a89300
             mov edx , ebx                                                   ;0x004b6755 :        8bd3
             call Fun414b0d                                                  ;0x004b6757 :        e8b1e3f5ff


     ;
     ;                 ---------------------------------------------------------------------------------
     ;                      VFP 9.0 FIX - THE MAXIMUM NUMBER OF CHARACTERS FOR THE SET PATH COMMAND
     ;                                November 2019
     ;                 ---------------------------------------------------------------------------------
     ;                                     CCB
     ;
     ; In vfp9, the maximum number of characters for the SET PATH command (and the SET("PATH") function) is 4095,
     ; now the maximum number of characters for the SET PATH command (and the SET("PATH") function) is 8191.
     ;
     ; 2019/11/20, by ccb
     ;

     Label4b675b ::
     ;         mov dword ptr vfpa_setpath_issetpath,00h


     Label4b675c ::
             jmp Label52c900                                                 ;0x004b675c :        e99f610700

     Label52c900 ::
             xor eax , eax                                                   ;0x0052c900 :        33c0
             lea esp ,  dword ptr [ ebp + 0FFFFF964h ]                       ;0x0052c902 :        8da564f9ffff
             mov  ecx , dword ptr [ ebp + 116 ]                              ;0x0052c908 :        8b4d74
             call Fun42bf1d                                                  ;0x0052c90b :        e80df6efff
             pop edi                                                         ;0x0052c910 :        5f
             pop esi                                                         ;0x0052c911 :        5e
             pop ebx                                                         ;0x0052c912 :        5b
             add ebp , 078h                                                  ;0x0052c913 :        83c578
             leave                                                           ;0x0052c916 :        c9
             ret                                                             ;0x0052c917 :        c3


4. APPLIES TO:

     VFP 6.0.8167.0
     VFP 6.0.8961.0 (SP5)

     VFP 7.0.0.9262
     VFP 7.0.0.9465 (SP1)

     VFP 8.0.0.2521
     VFP 8.0.0.3117 (SP1)

     VFP 9.0.0.2412
     VFP 9.0.0.3504 (SP1)
     VFP 9.0.0.4611 (SP2)
     VFP 9.0.0.5015 (SP2)
     VFP 9.0.0.5411 (SP2)
     VFP 9.0.0.5721 (SP2)
     VFP 9.0.0.5815 (SP2)
     VFP 9.0.0.6303 (SP2)
     VFP 9.0.0.6602 (SP2)
     VFP 9.0.0.7423 (SP2)

     The bug has been fixed in VFP Advanced.


5. REFERENCE WEBSITES:

     1, baiyujia.com:
     http://www.baiyujia.com
     http://www.baiyujia.com/vfpdocuments/f_vfp9fix100.asp
     http://www.baiyujia.com/vfpdocuments/f_vfp9fix102.asp
     http://www.baiyujia.com/vfpdocuments/f_vfp9fix287.asp
     http://www.baiyujia.com/vfpdocuments/f_vfp9fix354.asp
     http://www.baiyujia.com/vfpdocuments/f_vfp9fix355.asp


6. OTHER:

     For reference only, there is no guarantees.

     Any questions or suggestions, please send me an email at ccb2000@163.com.