Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 253421
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T21:45:37+00:00 2026-05-11T21:45:37+00:00

Suppose I have a patch that can be applied with -p0, is there a

  • 0

Suppose I have a patch that can be applied with -p0, is there a tool to automatically transform this patch into a -p1 patch. For example, transforming

Index: stdio-common/_i18n_number.h
===================================================================
--- stdio-common/_i18n_number.h (revision 8348)
+++ stdio-common/_i18n_number.h (working copy)
@@ -116,7 +116,7 @@ _i18n_number_rewrite (CHAR_T *w, CHAR_T
 #else

 static CHAR_T *
-_i18n_number_rewrite (CHAR_T *w, CHAR_T *rear_ptr)
+_i18n_number_rewrite (CHAR_T *w, CHAR_T *rear_ptr, CHAR_T *end)
 {
   return w;
 }

Into the same patch but with different directory name (notice the a, b) in front of the path

Index: stdio-common/_i18n_number.h
===================================================================
--- a/stdio-common/_i18n_number.h (revision 8348)
+++ b/stdio-common/_i18n_number.h (working copy)
@@ -116,7 +116,7 @@ _i18n_number_rewrite (CHAR_T *w, CHAR_T
 #else

 static CHAR_T *
-_i18n_number_rewrite (CHAR_T *w, CHAR_T *rear_ptr)
+_i18n_number_rewrite (CHAR_T *w, CHAR_T *rear_ptr, CHAR_T *end)
 {
   return w;
 }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T21:45:37+00:00Added an answer on May 11, 2026 at 9:45 pm

    Simply transforming the filenames in the diff chunk headers is good enough.

    sed \
        -e 's!^--- !&a/!' \
        -e 's!^+++ !&b/!' \
        < p0.patch \
        > p1.patch
    

    For other patch mangling tools, I’d suggest patchutils, but this one is so simple that there’s no pre-existing utility for it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Suppose I have: Toby Tiny Tory Tily Is there an algorithm that can easily
Suppose I have a stringbuilder in C# that does this: StringBuilder sb = new
Suppose I have a table called Companies that has a DepartmentID column. There's also
Background: Suppose I have a website that is hosted on http://www.example.com and the site
suppose i have a jax-rs resource class that looks like this: @Path(/nodes) public class
Suppose I have a url http://www.somesite.com/path/to/catalyst/controller And I want to redirect this to http://www.somesite.com/extra-part/path/to/catalyst/controller
Suppose I have a git repos that contains original.script . At some point, I
Let's suppose I have the following url: /valid/django/app/path/?foo=bar&spam=eggs I can simulate a request to
Suppose there is a site where we are uploading images. Now, when we have
I have a folder and inside that, few files. How can i get that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.