View | Details | Raw Unified | Return to bug 517 | Differences between
and this patch

Collapse All | Expand All

(-)sftp-int.c.org (-2 / +22 lines)
Lines 325-331 Link Here
325
{
325
{
326
	const char *cp = *cpp, *end;
326
	const char *cp = *cpp, *end;
327
	char quot;
327
	char quot;
328
	int i;
328
	int i, j;
329
329
330
	cp += strspn(cp, WHITESPACE);
330
	cp += strspn(cp, WHITESPACE);
331
	if (!*cp) {
331
	if (!*cp) {
Lines 338-344 Link Here
338
	if (*cp == '\"' || *cp == '\'') {
338
	if (*cp == '\"' || *cp == '\'') {
339
		quot = *cp++;
339
		quot = *cp++;
340
340
341
		end = strchr(cp, quot);
341
		/* This block finds the 'bare' quote that
342
		    denotes the end of the filename and checks
343
		    to make sure that it's not an escaped quote
344
		    that should be part of the filename */
345
		end = cp;
346
		j=0;
347
		while(j <= strlen(end)){
348
			if(*(end + j) == '"'){
349
				end += j;
350
				break;
351
			}
352
			if(*(end + j) == '\\'){
353
				j += 2;
354
			} else {
355
				j++;
356
			}
357
		}
358
		
359
		if(--j == strlen(cp))
360
			end = NULL;
361
342
		if (end == NULL) {
362
		if (end == NULL) {
343
			error("Unterminated quote");
363
			error("Unterminated quote");
344
			goto fail;
364
			goto fail;

Return to bug 517