View | Details | Raw Unified
Collapse All | Expand All

(-) wrapper-1.4.2.c.orig (-10 / +9 lines)
 Lines 39-45    Link Here 
static const char *wrapper_strerror(int err, struct wrapper_data *data)
static const char *wrapper_strerror(int err, struct wrapper_data *data)
{
{
	strerror_r(err, data->tmp, sizeof(data->tmp));
	/* this program doesn't need to be thread safe. If it becomes
	** more portable with strerror, I think its a good call.
	*/
	strncpy(data->tmp, strerror(err), sizeof(data->tmp));
	return data->tmp;
	return data->tmp;
}
}
 Lines 155-161    Link Here 
				/* A bash variable may be unquoted, quoted with " or
				/* A bash variable may be unquoted, quoted with " or
				 * quoted with ', so extract the value without those ..
				 * quoted with ', so extract the value without those ..
				 */
				 */
				token = strsep(&strp, "\n\"\'");
				token = strtok(strp, "\n\"\'");
				while (NULL != token) {
				while (NULL != token) {
					
					
 Lines 165-171    Link Here 
						return 1;
						return 1;
					}
					}
					token = strsep(&strp, "\n\"\'");
					token = strtok(NULL, "\n\"\'");
				}
				}
			}
			}
			
			
 Lines 247-265    Link Here 
			return;
			return;
	}
	}
	len = strlen(dname) + strlen(data->path) + 2;
	len = strlen(dname) + strlen(data->path) + 2 + strlen("PATH") + 1;
	newpath = (char *)malloc(len);
	newpath = (char *)malloc(len);
	if (NULL == newpath)
	if (NULL == newpath)
		wrapper_exit("out of memory\n");
		wrapper_exit("out of memory\n");
	memset(newpath, 0, len);
	memset(newpath, 0, len);
	snprintf(newpath, len, "%s:%s", dname, data->path);
	snprintf(newpath, len, "PATH=%s:%s", dname, data->path);
	setenv("PATH", newpath, 1);
	putenv(newpath);
	if (newpath)
		free(newpath);
	newpath = NULL;
}
}
int main(int argc, char **argv) 
int main(int argc, char **argv)