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

Collapse All | Expand All

(-)./src/server.c (-10 / +27 lines)
Lines 1270-1286 Link Here
1270
		return;
1270
		return;
1271
	}
1271
	}
1272
1272
1273
	oldname = strtok(cp, " ");
1273
{ unsigned int len;
1274
	if (oldname == NULL) {
1275
		error("hardlink: oldname name not delimited");
1276
		return;
1277
	}
1278
1274
1279
	newname = strtok((char *)NULL, " ");
1275
  if( *( cp += strspn( cp, " " ) ) == '\0' ) {
1280
	if (newname == NULL) {
1276
    error("hardlink: oldnamelen name not found");
1281
		error("hardlink: new name not specified");
1277
    return;
1282
		return;
1278
  }
1283
	}
1279
1280
  len = strtoul( cp, &cp, 10 );
1281
1282
  if( *( cp += strspn( cp, " " ) ) == '\0' ) {
1283
    error("hardlink: oldname not found");
1284
    return;
1285
  }
1286
  oldname = cp;
1287
  if( strlen( cp ) < len + 2 ) {
1288
    error("hardlink: oldname too short or nothing following found");
1289
    return;
1290
  }
1291
  cp += len;
1292
  *cp++ = '\0';
1293
1294
  if( *( cp += strspn( cp, " " ) ) == '\0' ) {
1295
    error("hardlink: newname not found");
1296
    return;
1297
  }
1298
1299
  newname = cp;
1300
}
1284
1301
1285
	if (exptilde(expbuf, oldname) == NULL) {
1302
	if (exptilde(expbuf, oldname) == NULL) {
1286
		error("hardlink: tilde expansion failed");
1303
		error("hardlink: tilde expansion failed");
(-)./src/client.c (-4 / +4 lines)
Lines 359-374 Link Here
359
		 rname, lp->pathname, lp->src, lp->target);
359
		 rname, lp->pathname, lp->src, lp->target);
360
		 
360
		 
361
	if (*lp->target == CNULL)
361
	if (*lp->target == CNULL)
362
		(void) sendcmd(C_RECVHARDLINK, "%o %s %s", 
362
		(void) sendcmd(C_RECVHARDLINK, "%o %d %s %s", 
363
			       opts, lp->pathname, rname);
363
			       opts, strlen(lp->pathname), lp->pathname, rname);
364
	else {
364
	else {
365
		lname = buff;
365
		lname = buff;
366
		strcpy(lname, remfilename(lp->src, lp->target, 
366
		strcpy(lname, remfilename(lp->src, lp->target, 
367
					  lp->pathname, rname, 
367
					  lp->pathname, rname, 
368
					  destdir));
368
					  destdir));
369
		debugmsg(DM_MISC, "sendhardlink: lname=%s\n", lname);
369
		debugmsg(DM_MISC, "sendhardlink: lname=%s\n", lname);
370
		(void) sendcmd(C_RECVHARDLINK, "%o %s %s", 
370
		(void) sendcmd(C_RECVHARDLINK, "%o %d %s %s", 
371
			       opts, lname, rname);
371
			       opts, strlen(lname), lname, rname);
372
	}
372
	}
373
373
374
	return(response());
374
	return(response());

Return to bug 247596