Subversion Repositories Kolibri OS

Rev

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

Rev 6857 Rev 7787
Line 21... Line 21...
21
if (CMD_HISTORY_NUM_REAL < CMD_HISTORY_NUM-1)
21
if (CMD_HISTORY_NUM_REAL < CMD_HISTORY_NUM-1)
22
	CMD_HISTORY_NUM_REAL++;
22
	CMD_HISTORY_NUM_REAL++;
Line 23... Line 23...
23
 
23
 
-
 
24
}
Line -... Line 25...
-
 
25
// ============================================================
-
 
26
 
-
 
27
char * insert_string( char s1[], unsigned int pos, const char s2[] )
-
 
28
{
-
 
29
    unsigned int n1 = strlen( s1 );
-
 
30
    unsigned int n2 = strlen( s2 );
-
 
31
 
-
 
32
    if ( n1 < pos ) pos = n1;
-
 
33
 
-
 
34
    unsigned int i;
-
 
35
    for (  i = 0; i < n1 - pos; i++ )
-
 
36
    {
-
 
37
        s1[n1 + n2 - i - 1] = s1[n1 - i - 1];
-
 
38
    }
-
 
39
 
-
 
40
    for ( i = 0; i < n2; i++)
-
 
41
    {
-
 
42
        s1[pos+i] = s2[i];
-
 
43
    }
Line -... Line 44...
-
 
44
 
-
 
45
    s1[n1 + n2] = '\0';
Line 24... Line 46...
24
}
46
 
Line 25... Line 47...
25
 
47
    return s1;
26
 
48
}
Line 100... Line 122...
100
						if ((int)*(clipBuf+4)==0) // text?
122
						if ((int)*(clipBuf+4)==0) // text?
101
							{
123
							{
102
							if ((int)*(clipBuf+8)==1) // 866 encoding?
124
							if ((int)*(clipBuf+8)==1) // 866 encoding?
103
								{
125
								{
104
								for (i = cmdPos; i < cmdLen; i++)
126
									// clear previous text
-
 
127
									for (i = cmdPos; i < cmdLen; i++)
105
									printf(" ");
128
										printf(" ");
106
								for (i = cmdLen; i > 0; i--)
129
									for (i = cmdLen; i > 0; i--)
107
									printf("%c %c", 8, 8);
130
										printf("%c %c", 8, 8);
108
								cmdLen = 0;
131
 
109
								cmdPos = 0;
-
 
110
								CMD[0] = '\0';
-
 
111
 
-
 
112
								// strcpy_n
-
 
113
								for (i = 0; i < 255; i++)
-
 
114
									{
-
 
115
									CMD[i]=*(clipBuf+12+i);
-
 
116
									if (CMD[i]=='\0')
-
 
117
										break;
-
 
118
									}
-
 
119
								
-
 
Line -... Line 132...
-
 
132
									char *pasteText = clipBuf + 12;
120
								cmdPos = cmdLen = strlen(CMD);
133
									int pasteLen = strlen(pasteText);
121
/*								
-
 
122
								printf("Length: %d\n", cmdLen);
134
									insert_string(CMD, cmdPos, pasteText);
123
								for (i = 0; i < cmdLen; i++)
135
									cmdLen = strlen(CMD);
124
									printf("%d ", CMD[i]);
136
									cmdPos += pasteLen;
125
*/
-
 
126
								printf("%s", CMD);
137
									printf("%s", CMD);
127
 
-
 
-
 
138
                                    for (i = 0; i < cmdLen-cmdPos; i++) printf("%c", 8); // rewind the internal console cursor
128
								}
139
								}
129
							}
140
							}
130
						}
141
						}
131
					}
142
					}
132
				break;
143
				break;
Line 204... Line 215...
204
						cmdLen--;
215
						cmdLen--;
205
					}
216
					}
206
				break;
217
				break;
Line -... Line 218...
-
 
218
 
-
 
219
 
-
 
220
			case 0x47: // Home
-
 
221
				// move internal cursor and cmdPos to the beginning of the line
-
 
222
				for (;cmdPos > 0; cmdPos--) {printf("%c", 8);}
-
 
223
				break;
-
 
224
 
-
 
225
			case 0x4F: // End
-
 
226
				// move internal cursor and cmdPos to the end of the line 
-
 
227
				for (;cmdPos < cmdLen; cmdPos++) {printf("%c", CMD[cmdPos]);}
-
 
228
				break;
207
 
229
 
208
			case 75: // Left
230
			case 75: // Left
209
				if (cmdPos > 0)
231
				if (cmdPos > 0)
210
					{
232
					{
211
						printf("%c", 8);
233
						printf("%c", 8);